Blank merge fields

A

ASBiss

I can see from previous postings that it is possible to supress a field if
it's blank.

However, from the answers given I can't quite work out how to insert the If
then else field. ie

Title Name Surname

In some cases I don't have a title and want to omit the space before if
there isn't one so just Name and Surname appear on the letter

Could someone explain this to me in layman's terms!?
 
P

Peter Jamieson

The simplest way to insert IF fields is, in my view, to avoid Word's field
insertion dialog boxes and do it more directly. The main keystrokes you need
are
a. Ctrl-F9, which inserts a pair of the special "field braces" {} that
surround each field. Everything between those special {} can be plain text
that you type in the usual way.
b. Alt-F9, which lets you toggle between "field code view", where fields
look like { MERGEFIELD myfield }, and "field preview/results" view, where
mergefields show as <<myfield>> or their results
c. select a field and press F9 to update its result.

In this case, one way you can do it is

{ IF { MERGEFIELD Title } = "" "" "{ MERGEFIELD Title } "
}{ MERGEFIELD Name } { MERGEFIELD Surname }

although I would probably use

{ IF "{ MERGEFIELD Title }" = "" "" "{ MERGEFIELD Title } "
}{ MERGEFIELD Name } { MERGEFIELD Surname }

simply to play safe.

For the IF field you can do the following

1. ctrl-F9:
{ }
2. Put the insertion point after the opening brace and the first space, and
type everything outside the fields:
{ IF "" = "" "" " " }
NB, you must have a space either side of the = sign.
3. Then put the insertion point inside the first "" and use crtl-F9 again:
{ IF "{ }" = "" "" " " }
4. Put the insertion point inside the new { } and type MERGEFIELD Title:
{ IF "{ MERGEFIELD Title }" = "" "" " " }
5. repeat (3) and (4) to insert the second MERGEFIELD field:
{ IF "{ MERGEFIELD Title }" = "" "" "{ MERGEFIELD Title } " }

As an alternative to (3),(4),(5), you can put the insertion point where you
want the field to go and use the appropriate button on the merge toolbar to
insert the MERGEFIELD fields. You may find that you need to use Alt-F9 to
get back to the field code view to insert the next merge field.

If that isn't what you needed to know, let us know where you're getting
stuck.

Peter Jamieson
 

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