Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / July 2007

Tip: Looking for answers? Try searching our database.

How to suppress the blank lines while mering fields in Word docume

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
CoolVBA - 26 Jun 2007 03:04 GMT
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.
Doug Robbins - Word MVP - 26 Jun 2007 09:33 GMT
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.

Signature

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

> 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
[quoted text clipped - 14 lines]
> it's
> not what I wanted.
CoolVBA - 02 Jul 2007 09:04 GMT
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...

> 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.
[quoted text clipped - 17 lines]
> > it's
> > not what I wanted.
CoolVBA - 02 Jul 2007 09:08 GMT
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 diffcuilt to manage all the Next fields while if...then...else
construction used...

> 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.
[quoted text clipped - 17 lines]
> > it's
> > not what I wanted.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.