Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for word "mail merge" fields #487

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cjbaar
Copy link

@cjbaar cjbaar commented Mar 6, 2015

Recently used this library for a project which required inline text substitution. Legacy document was already built using pre-defined merge fields, and given it's large size, we did not want to reformat to take advantage of the existing setValue() method. I created some new functions to allow replacement of text using the pre-defined merge fields, allowing the same document to be converted using both the older manual method and the new programmatic (PHPWord) method. This is based on a limited set of Word merge documents, but so far all replacements are successful.

@gfobe
Copy link

gfobe commented May 20, 2017

The RegEx searching for w:instr=" MERGEFIELD does not trigger in my document Placeholder.docx

@cjbaar
Copy link
Author

cjbaar commented May 22, 2017

@gfobe: Your document is using a merge field format that we did not encounter on our project. It looks like there are two different types of merge field in Word: simple and complex. We currently only have used the complex method. According to what I have read, if there is only one merge field on a document, it default to simple. As a short work-around, try adding a second merge field in the document and see if that changes things. (You should see fldChar tags instead of fldSimple)

@FBnil
Copy link

FBnil commented Oct 21, 2017

See also #1050

@github-actions
Copy link

This PR has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If this is still an issue for you, please try to complete the PR by adding tests and making sure that the CI is green.
Thank you for your contributions.

@github-actions github-actions bot added the Stale label Nov 18, 2022
@Progi1984 Progi1984 removed the Stale label Nov 18, 2022
@Progi1984 Progi1984 force-pushed the master branch 3 times, most recently from 2d9f999 to e458249 Compare August 30, 2023 11:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

5 participants