A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Mail Merge - insert different phrase based on date value?



 
 
Thread Tools Display Modes
  #1  
Old August 27th, 2009, 01:32 AM posted to microsoft.public.word.mailmerge.fields
Martha
external usenet poster
 
Posts: 86
Default Mail Merge - insert different phrase based on date value?

My organization prints a Saint name next to the date, and it changes based on
the date. I know I could put all these dates/Saint names in excel and do a
lookup and then use the result in the mailmerge. However, is there a way to
do something similar with Word - so I could insert all the dates/Saints
someplace under "Insert",then be able to put the code to pull up the right
value? I suppose I could build a huge nested if - but I doubt I could do a
265 one. And I guess I could build 12 - based on month so it would be
somewhat more managable. I want to make this as simple as possible for the
people who do the letters, and I'm afraid the excel solution would be scary
for them.

I'm suspecting the answer is "no way" - but before I give up, I thought I'd
go to the experts! Thanks
Martha
  #2  
Old August 27th, 2009, 05:31 AM posted to microsoft.public.word.mailmerge.fields
macropod[_2_]
external usenet poster
 
Posts: 2,402
Default Mail Merge - insert different phrase based on date value?

Hi Martha,

Rather than nested IFs, which can only go 20 levels deep in Word, you can use a series of independent IFs, coded along the lines of:
{IF{DATE \@ MMDD}= 0101 "Michael"}
{IF{DATE \@ MMDD}= 0102 "Peter"}
{IF{DATE \@ MMDD}= 0103 "John"}
{IF{DATE \@ MMDD}= 0104 "Matthew"}
....
{IF{DATE \@ MMDD}= 0201 "Mark"}
{IF{DATE \@ MMDD}= 0202 "Luke"}
{IF{DATE \@ MMDD}= 0203 "Paul"}
etc

In reality, you'd put these fields sequentially on the same logical line, as in:
{IF{DATE \@ MMDD}= 0101 "Michael"}{IF{DATE \@ MMDD}= 0102 "Peter"}{IF{DATE \@ MMDD}= 0103 "John"}{IF{DATE \@ MMDD}= 0104 "Matthew"}
....

The above field coding uses the system date to determine which name to display. If you're pulling the dates from a mailmerge, change
'DATE' to 'MERGEFIELD MyDate', where 'MyDate' is your mergefield name.

Note: The field brace pairs (ie '{ }') for the above example are created via Ctrl-F9 - you can't simply type them or copy & paste
them from this message.

--
Cheers
macropod
[Microsoft MVP - Word]


"Martha" wrote in message ...
My organization prints a Saint name next to the date, and it changes based on
the date. I know I could put all these dates/Saint names in excel and do a
lookup and then use the result in the mailmerge. However, is there a way to
do something similar with Word - so I could insert all the dates/Saints
someplace under "Insert",then be able to put the code to pull up the right
value? I suppose I could build a huge nested if - but I doubt I could do a
265 one. And I guess I could build 12 - based on month so it would be
somewhat more managable. I want to make this as simple as possible for the
people who do the letters, and I'm afraid the excel solution would be scary
for them.

I'm suspecting the answer is "no way" - but before I give up, I thought I'd
go to the experts! Thanks
Martha


 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 03:18 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.