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" <CoolVBA[ at ]discussions.microsoft.com> wrote in message news:73B08005-948A-425F-A8FF-F4DE223CD176[ at ]microsoft.com...
[Quoted Text] > 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. >
|