Fields Based On DocVariables that are empty/missing

M

ML

Is there a way to suppress the error that a field gives in the case that the
docvariable that it is referencing does not exist?

My variables may or may not be created and I need to stop the field from
showing the error if it is not there and just be blank instead.
 
C

Charles Kenyon

There is no way to suppress this for existing fields. You can either delete
the fields or put something in the variable. Most people using such fields
with vba make sure there is an existing variable even if all it contains is
a space.
--
Charles Kenyon

Word New User FAQ & Web Directory: http://addbalance.com/word

Intermediate User's Guide to Microsoft Word (supplemented version of
Microsoft's Legal Users' Guide) http://addbalance.com/usersguide

See also the MVP FAQ: http://www.mvps.org/word which is awesome!
--------- --------- --------- --------- --------- ---------
This message is posted to a newsgroup. Please post replies
and questions to the newsgroup so that others can learn
from my ignorance and your wisdom.
 
M

ML

The issue I have is that I am trying to make page level variables somehow.
I figured I could use these and make them on the fly as needed when the user
sets them. The issue is if they do not exists I need to be able to handle
this as they are referenced on the page as part of a field using nested IF.
 
M

ML

The issue I have is that I am trying to make page level variables somehow.
I figured I could use these and make them on the fly as needed when the user
sets them. The issue is if they do not exists I need to be able to handle
this as they are referenced on the page as part of a field using nested IF.
 
C

Cindy M -WordMVP-

Hi Ml,
Is there a way to suppress the error that a field gives in the case that the
docvariable that it is referencing does not exist?
You should be able to nest it in an IF field, testing the exact error message
you get if the DocVar is non-existant. Roughly

{ IF { DocVariable Test } = "Error! Whatever..." "" "{ DocVariable Test}" }

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or reply
in the newsgroup and not by e-mail :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top