Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
sokab sokab is offline
external usenet poster
 
Posts: 1
Default How do I create a merge field that will do the following?

I need to create a Word mergefield that will return last month's name and
year. For example: We are currently in the month of September. When the
field is merged, it will return "August 2007". If the letter is merged in
October, the field will return "September 2007".
  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dav Dav is offline
external usenet poster
 
Posts: 8
Default How do I create a merge field that will do the following?

Hi There

Here is my proposal

{IF {MERGEDATE \@ "MM"} = 1 "December {DATE \@ "yyyy"}" "{IF {MERGEDATE \@
"MM"} = 2 "January {DATE \@ "yyyy"}" "{IF{MERGEDATE \@ "MM"} = 3 "February
{DATE \@ "yyyy"}" "'{IF {MERGEDATE \@ "MM"} = 4 "March {DATE \@ "yyyy"}"
"{IF {MERGEDATE \@ "MM"} = 5 "April {DATE \@ "yyyy"}" "{IF {MERGEDATE \@
"MM"} = 6 "May {DATE \@ "yyyy"}" "{IF {MERGEDATE \@ "MM"} = 7 "June {DATE \@
"yyyy"}" "{IF {MERGEDATE \@ "MM"} = 8 "July {DATE \@ "yyyy"}" "{IF
{MERGEDATE \@ "MM"}= 9 "August {DATE \@ "yyyy"}" "{IF {MERGEDATE \@ "MM"} =
10 "September {DATE \@ "yyyy"}" "{IF {MERGEDATE \@ "MM"} = 11 "October {DATE
\@ "yyyy"}" "{IF {MERGEDATE \@ "MM"} = 12 "November {DATE \@ "yyyy"}"
""}"}"}"}"}"}"}"}"}"}"}"}

Insert all {} using Ctrl+F9

Hope it helps (hope it works too ;o))

Greetings from France

Dav



"sokab" a écrit dans le message de
...
I need to create a Word mergefield that will return last month's name and
year. For example: We are currently in the month of September. When the
field is merged, it will return "August 2007". If the letter is merged in
October, the field will return "September 2007".


  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod macropod is offline
external usenet poster
 
Posts: 1,002
Default How do I create a merge field that will do the following?

Hi sokab,

A simple field construction like:
{QUOTE
{SET Delay -1}
{SET MDATE {MERGEFIELD SourceDate}}
{SET m{=MOD({MDATE \@ MM}+Delay+11,12)+1}}
{SET y{=INT({MDATE \@ yyyy}+(Delay+{MDATE \@ M}-1)/12)}}
"{m}-{y}" \@ "MMMM yyyy"}
will return the month and year. But - do you want just the month and year, or the day, month and year (taking account of different
month lengths)?

Whichever it is you can see how to do that and just about everything else you might want to do with dates in Word, in my Date Calc
'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902
or
http://www.gmayor.com/downloads.htm#Third_party
In particular, look at the topic titled 'Automatically insert a past or future date'.

Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"sokab" wrote in message ...
I need to create a Word mergefield that will return last month's name and
year. For example: We are currently in the month of September. When the
field is merged, it will return "August 2007". If the letter is merged in
October, the field will return "September 2007".


  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dav Dav is offline
external usenet poster
 
Posts: 8
Default How do I create a merge field that will do the following?

Hi Macropod

"macropod" a écrit dans le message de
...
Hi sokab,

A simple field construction like:


Whichever it is you can see how to do that and just about everything else
you might want to do with dates in Word, in my Date Calc 'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902


Sadly, this link doesn't work

Dav


Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"sokab" wrote in message
...
I need to create a Word mergefield that will return last month's name and
year. For example: We are currently in the month of September. When the
field is merged, it will return "August 2007". If the letter is merged
in
October, the field will return "September 2007".



  #5   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default How do I create a merge field that will do the following?

Use the second link http://www.gmayor.com/downloads.htm#Third_party as WOPR
is down at present.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Dav wrote:
Hi Macropod

"macropod" a écrit dans le message de
...
Hi sokab,

A simple field construction like:


Whichever it is you can see how to do that and just about everything
else you might want to do with dates in Word, in my Date Calc
'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902


Sadly, this link doesn't work

Dav


Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"sokab" wrote in message
...
I need to create a Word mergefield that will return last month's
name and year. For example: We are currently in the month of
September. When the field is merged, it will return "August 2007".
If the letter is merged in
October, the field will return "September 2007".





  #6   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Dav Dav is offline
external usenet poster
 
Posts: 8
Default How do I create a merge field that will do the following?

Hi Graham

Really great. Thanks.
And really very interesting !

Dav

"Graham Mayor" a écrit dans le message de
...
Use the second link http://www.gmayor.com/downloads.htm#Third_party as
WOPR is down at present.

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Dav wrote:
Hi Macropod

"macropod" a écrit dans le message de
...
Hi sokab,

A simple field construction like:


Whichever it is you can see how to do that and just about everything
else you might want to do with dates in Word, in my Date Calc
'tutorial', at:
http://www.wopr.com/cgi-bin/w3t/show...?Number=249902


Sadly, this link doesn't work

Dav


Cheers
--
macropod
[MVP - Microsoft Word]
-------------------------

"sokab" wrote in message
...
I need to create a Word mergefield that will return last month's
name and year. For example: We are currently in the month of
September. When the field is merged, it will return "August 2007".
If the letter is merged in
October, the field will return "September 2007".




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
How to create an email from mail merge including a hyperlink, so that the value of a merged field is included as part of the hyperlink URL, not just part of its text. [email protected] Mailmerge 4 August 22nd 07 06:18 PM
Create formula using a merge field Seth Schwarm Microsoft Word Help 1 October 30th 06 11:59 PM
How to create subheadings for repeating field in mail merge direct Cafe Sport Mailmerge 2 January 6th 06 01:41 AM
create a macro in a merge document field wilddove Mailmerge 3 June 15th 05 11:14 AM
how do i create a page break based on a mail merge field chris Mailmerge 1 February 24th 05 05:08 PM


All times are GMT +1. The time now is 01:33 PM.

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"