Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
M. Funn M. Funn is offline
external usenet poster
 
Posts: 1
Default make a merge field go to next merge field if prior one is blank?

I have a word document that I am merging with an excel spreadsheet. In the
word document there are three choices for the recipient i woudl like the
merge to go to the next choice if the first one is blank and so on. I have
tried to use the "If then else" field but I am a beginner and have not had
luck with this.
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default make a merge field go to next merge field if prior one is blank?

Assuming that what you mean is that your Spreadsheet has 3 columns, and in
each row, one, two or perhaps even all three of those columns could be blank
/and/ it is OK simply to start checking with the first column and move to
the next as you say, what you need is something like

{ IF "{ MERGEFIELD column1 }" "" "{ MERGEFIELD column1 }"
"{ IF "{ MERGEFIELD column2 }" "" "{ MERGEFIELD column2 }"
"{ IF "{ MERGEFIELD column3 }" "" "{ MERGEFIELD column3 }"
"some other value if all three are blank?" }" }" }

This can all be on one line, but all the {} need to be the special field
braces that you can insert using ctrl-F9 - you can't just type them on the
keyboard. Everything else is plain text. I include the spaces and quotes
partly because that's the way Word usually does it, and partly as a
defensive programming strategy, but many people would drop quite a few of
them.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"M. Funn" M. wrote in message
...
I have a word document that I am merging with an excel spreadsheet. In the
word document there are three choices for the recipient i woudl like the
merge to go to the next choice if the first one is blank and so on. I
have
tried to use the "If then else" field but I am a beginner and have not had
luck with this.


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
M. Funn[_2_] M. Funn[_2_] is offline
external usenet poster
 
Posts: 1
Default make a merge field go to next merge field if prior one is blan

Thank you I will try this.

"Peter Jamieson" wrote:

Assuming that what you mean is that your Spreadsheet has 3 columns, and in
each row, one, two or perhaps even all three of those columns could be blank
/and/ it is OK simply to start checking with the first column and move to
the next as you say, what you need is something like

{ IF "{ MERGEFIELD column1 }" "" "{ MERGEFIELD column1 }"
"{ IF "{ MERGEFIELD column2 }" "" "{ MERGEFIELD column2 }"
"{ IF "{ MERGEFIELD column3 }" "" "{ MERGEFIELD column3 }"
"some other value if all three are blank?" }" }" }

This can all be on one line, but all the {} need to be the special field
braces that you can insert using ctrl-F9 - you can't just type them on the
keyboard. Everything else is plain text. I include the spaces and quotes
partly because that's the way Word usually does it, and partly as a
defensive programming strategy, but many people would drop quite a few of
them.

--
Peter Jamieson
http://tips.pjmsn.me.uk

"M. Funn" M. wrote in message
...
I have a word document that I am merging with an excel spreadsheet. In the
word document there are three choices for the recipient i woudl like the
merge to go to the next choice if the first one is blank and so on. I
have
tried to use the "If then else" field but I am a beginner and have not had
luck with this.



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
When I use mail merge, can I merge a field to make the file name? Mulsh50 Mailmerge 1 August 17th 07 04:14 AM
automatically inserting text in a merge field blank field. DrTominRI Mailmerge 2 December 20th 05 06:35 AM
How do I set mail merge field to not appear if blank? Visionary Soup Mailmerge 7 October 28th 05 06:05 PM
Blank merge field problem........Still! Visionary Soup Mailmerge 1 September 14th 05 09:50 PM
line feed when merge field is blank Bev Mailmerge 1 March 22nd 05 09:31 PM


All times are GMT +1. The time now is 12:52 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"