alternative way to replace a space in DOCVARIABLE

A

Associates

Hi,

I wonder if i could get some help here. I have been using DOCVARIABLE all
over my template that is designed to generate a covering letter. Users will
have to fill out the empty fields in the form when the template is run or
open. However, i notice that there are some blank space here and there in the
document. I believe this is caused by the fact that some of the fields are
left empty.

The way i handle empty fields in VB codes is to insert a space (i.e. " ") in
the DOCVARIABLE. It gives me error message like "Error - no document variable
supplied" when i used "" rather than " ". The downside of this is of course,
i got empty space in the letter. Sometimes, it can look a bit silly.

I wonder if there are any way of working around this.

I use office 2002.

Thank you in advance
 
D

Doug Robbins - Word MVP

In your document, use the following field construction:

{ IF { DOCVARIABLE varname } = "Error! No document variable supplied." ""
{ DOCVARIABLE varname } }

--
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, originally posted via msnews.microsoft.com
 

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