S
Slash
I am using a system that interfaces with MS/Word. The system allows me to
create some mailmerge documents.
The first document is a source document that holds a single merge field on a
line as the only content.
{ MERGEFIELD Reference_Number }
When this resolves it creates a document C:\TEMP\\LAP\\INTDLIFE.DOC
containing the value of a database field called Reference_Number.
A second document (also a mailmerge), pulls in the first document using
{ INCLUDETEXT "c:\\temp\\LAP\\INTDLIFE.DOC" }
Now the problem is, when it includes the document it also includes the
paragraph marker following the mergefield, and thus in the final resolved
document their is an unwanted line break inserted, resulting in a blank line.
I have read that this can be removed by defining a bookmark in the original
document containing the merge field, by defining the bookmark over the
mergefield but excluding the paragraph marker. Then in the second document
expanding the INCLUDETEXT as follows
{ INCLUDETEXT "c:\\temp\\LAP\\INTDLIFE.DOC" BookmarkName }
I tried this however it returned the message "Bookmark not found" or wording
similar to this. This being because when the first document resolves into c:\
\temp\\LAP\\INTDLIFE.DOC, the bookmark is not preserved into that resolved
document. I understand this is due to the bookmark name requiring to be
unique, however I have seen some code posted elsewhere that duplicates the
bookmark into the resolved document. I just cannot figure out how to do this
though in my situation.
I have no direct control over the documents other than creating them. The
system actually automates the production of the final document initiating all
the various steps of the mailmerge processes along the way. I am hoping it
is possible to insert some VBA in the initial document containing the merge
field, so that the bookmark is preserved in its resolved document, so that
the document containing the INCLUDETEXT can find it. Is this possible?
Many thanks
Stephen Lasham
create some mailmerge documents.
The first document is a source document that holds a single merge field on a
line as the only content.
{ MERGEFIELD Reference_Number }
When this resolves it creates a document C:\TEMP\\LAP\\INTDLIFE.DOC
containing the value of a database field called Reference_Number.
A second document (also a mailmerge), pulls in the first document using
{ INCLUDETEXT "c:\\temp\\LAP\\INTDLIFE.DOC" }
Now the problem is, when it includes the document it also includes the
paragraph marker following the mergefield, and thus in the final resolved
document their is an unwanted line break inserted, resulting in a blank line.
I have read that this can be removed by defining a bookmark in the original
document containing the merge field, by defining the bookmark over the
mergefield but excluding the paragraph marker. Then in the second document
expanding the INCLUDETEXT as follows
{ INCLUDETEXT "c:\\temp\\LAP\\INTDLIFE.DOC" BookmarkName }
I tried this however it returned the message "Bookmark not found" or wording
similar to this. This being because when the first document resolves into c:\
\temp\\LAP\\INTDLIFE.DOC, the bookmark is not preserved into that resolved
document. I understand this is due to the bookmark name requiring to be
unique, however I have seen some code posted elsewhere that duplicates the
bookmark into the resolved document. I just cannot figure out how to do this
though in my situation.
I have no direct control over the documents other than creating them. The
system actually automates the production of the final document initiating all
the various steps of the mailmerge processes along the way. I am hoping it
is possible to insert some VBA in the initial document containing the merge
field, so that the bookmark is preserved in its resolved document, so that
the document containing the INCLUDETEXT can find it. Is this possible?
Many thanks
Stephen Lasham