How to suppress the blank lines while mering fields in Word do
Thanks much!
My case is that a text file is used as the data source which is exported by
program, and users can insert any merge fileds into a Word document. So, it
seems too diffcuilt to manage all the Next Merge Fields while the If
....then...Else construction used...
"Doug Robbins - Word MVP" wrote:
You would need to use an If...then...Else construction in the mail merge
main document to test for data in the fields to achieve what you are after.
--
Hope this helps.
Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.
Doug Robbins - Word MVP
"CoolVBA" wrote in message
...
I'm using a Word OCX control to display document, and need toggle the
document display between merged and unmerged status, the VBA code seems as
below:
.mailmerge.opendatasourece(...)
.mailmerge.suppressblanklines = true
if ...
.mailmerge.viewmergefieldcodes = true
else
.mailmerge.viewmergefieldcodes = false
end if
After the above scripts run, I found the blank lines were never been
suppressed while empty fields existed, I know the .Execute() method can
suppress the blank lines, but it will permanently convert the doucment,
it's
not what I wanted.
|