Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Rhinorhino on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

I need a WORD EXPERT! Re: suppress print of empty bookmark.

Status
Not open for further replies.

PurpleUnicorn

Programmer
Joined
Mar 16, 2001
Messages
79
Location
US
I have an Access97 application with a form that allows the user to select a template (or templates) for printing. The templates contain bookmarks (getting their data from the Access form.)

My question is: if there is no data for a particular bookmark, is there a way to suppress the printing of the line? For example, if there are 5 address fields, but the user enters data in fields 1,2,4,5 - I don't want to see a blank line in the Word document where field 3 belongs.

Thanks,

Nancy
 
NancyR,
Since Dreamboat hasn't yet responded . . .
Do we need to give her a hard time for taking some time away from her computer?)

Word default settings will not print the blank line.
If they somehow got changed - Tools, Mail Merge. when the helper opens up, click on the merge button. The Merge to window will appear. In the bottom of the window, change the selection:
When Merging Records:
-Don't Print Blank Lines

Good Luck,
AngO
 
AngO,

Thanks for the tip - but I am not doing a merge, so I don't believe this option is available.

My Access form contains a list of templates that the user selects. They click a button on the form and Word opens up the selected document(s) and fills in the bookmarked data from the Access form.

Is there some way to suppress the blank lines in this situation?

Thanks,

Nancy
 
Hi NancyR,

I am no Word expert, but Help does not seem to indicate that it is possible to determine an empty bookmark without resorting to VBA.

Using VBA, it is possible to determine if a bookmark is empty or not...
Code:
Empty Property Example

This example determines whether the bookmark named "temp" exists and whether it is empty.

If ActiveDocument.Bookmarks.Exists("temp") = True Then
    If ActiveDocument.Bookmarks("temp").Empty = True Then _
    MsgBox "The Temp bookmark is empty"
End If
Hope this helps :-) Skip,
metzgsk@voughtaircraft.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top