Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: How to suppress the blank lines while mering fields in Word docume

Geek News

How to suppress the blank lines while mering fields in Word docume
CoolVBA 6/26/2007 2:04:01 AM
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.

Re: How to suppress the blank lines while mering fields in Word docume
"Doug Robbins - Word MVP" <dkr[ at ]REMOVECAPSmvps.org> 6/26/2007 8:33:56 AM
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.
>


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net