View Single Post
 
Old 04-13-2025, 04:30 AM
macropod's Avatar
macropod macropod is offline Windows 10 Office 2016
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,343
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Given that the information isn't to be printed, why are you writing into the document instead of populating document variables or custom document properties? Far simpler than writing to bookmarks.

As for your field coding, none of the field braces (i.e. {}) can be typed, which is what your problem description suggests you're doing. They should be created (in pairs) by pressing Ctrl-F9.

Regardless, the field code you're trying to use probably won't work the way you want it to. As coded, it returns an error message if the bookmark contains no data - which can be a perfectly valid result; it certainly doesn't mean what your output message suggests.

If the problem is you're trying to deal with is that a bookmark has been deleted (which poor coding or a user can do all too easily), Word will already display:
Error! Reference source not found.
So, if that's what you're trying to suppress, your field coding should be along the lines of:
{IF{REF BkMk} = "Error!*" "" {REF BkMk}}

None of this would be necessary if your document used document variables, especially, or custom document properties. The advantage of using document variables is that users can't delete them. Then, all your document needs instead of bookmarks and REF fields is just a set of DOCVARIABLE or DOCPROPERTY fields.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote