How to merge entirely different pages based on value of merge field

ε祈祈猫儿з 提交于 2021-02-08 09:37:11

问题


At my office we use documents with merge fields from Microsoft Word for a number of different functions. However, I can't find a way to merge entire pages based on the value of a merge field. For instance, there are different forms you have to use to notarize documents in different state. I want to set it up so that if the state chosen is MN, the document will generate the notary form for Minnesota, if the state chosen is NC, the document will generate the notary form for NC, etc. Is this possible?


回答1:


Assuming your mailmerge main document is stored in the same folder as your State letters, you could use a field in the mailmerge main document coded as:

{QUOTE{INCLUDETEXT "{FILENAME \p}//..//{MERGEFIELD State}.docx"}}

where whatever is returned by {MERGEFIELD State} matches the document name. For example it could return Minnesota or MN provided that's what the document is named.

Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac or, if you’re using a laptop, you might need to use Ctrl-Fn-F9); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field constructions are all required.



来源:https://stackoverflow.com/questions/54582111/how-to-merge-entirely-different-pages-based-on-value-of-merge-field

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!