If/Then/Else

J

JimPNicholls

I'm tying to utilise the If/Then/Else functionality in word but at the moment I can only output text. Is it possible to use this and output a field from the datasource if the condition is met? Also, can you output autotext using this method?
 
P

Peter Jamieson

I'm tying to utilise the If/Then/Else functionality in word but at the
moment I can only output text. Is it possible to use this and
output a field from the datasource if the condition is met?

Yes, but it's probably easier if you learn to insert fields directly using
ctrl-F9 (insert the {} ) and Alt-F9 (toggle codes/results)

Then e.g.
a. use ctrl-F9 to insert {}
b. type <space>IF<space> inside the {} to give you { IF }
c. use ctrl-F9 to insert another {} = { IF {}}
d. type <space>=<space>1<space>""<space>""<space>" to give you

{ IF {} = 1 "" "" }

(But use whatever comparison you need instead of "= 1"

To use a field as the "true" result, put the insertion point inside the
first "" and either pick the mergefield off the drop-down menu, if
available, or press ctrl-F9 then type MERGEFIELD thefieldname inside the new
{}
Also, can you output autotext using this method?

You should be able to use { AUTOTEXT theautotextname } instead of {
MERGEFIELD thefieldname }, but more complicated nesting may not work.

--
Peter Jamieson
MS Word MVP

JimPNicholls said:
I'm tying to utilise the If/Then/Else functionality in word but at the
moment I can only output text. Is it possible to use this and output a field
from the datasource if the condition is met? Also, can you output autotext
using this method?
 

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