Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
This may not be possible very easily.
I have a sentence in a mail merge doc which reads "Thank you for your letter dated 21st August 2009..." with the date being a mail merge field from Excel. The format of the mail merge field is {MERGEFIELD Date Required\@"DD MMMM YYYY"}which gives me 21 August 2010. Is it possible to :- 1. Have the "st" or "th" inserted after the day (i.e 21st or 19th) 2. Have it appear super script like it does if it is typed in word. -- Regards Andy Andy Roberts Win XP, Office 2007 |
#2
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
macropod has an example of this in his Word Date Calculation Tutorial, at:
http://lounge.windowssecrets.com/ind...owtopic=249902 or http://www.gmayor.com/downloads.htm#Third_party (He generally says "Do read the document's introductory material.") Last time I looked the example was titled "Insert A Date with Ordinal Numbering" Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 08:43, Andy Roberts wrote: This may not be possible very easily. I have a sentence in a mail merge doc which reads "Thank you for your letter dated 21st August 2009..." with the date being a mail merge field from Excel. The format of the mail merge field is {MERGEFIELD Date Required\@"DD MMMM YYYY"}which gives me 21 August 2010. Is it possible to :- 1. Have the "st" or "th" inserted after the day (i.e 21st or 19th) 2. Have it appear super script like it does if it is typed in word. |
#3
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Peter this is exactly what I needed once I managed to get my head around
it - thank you ever so much Can I have the merge field display blank when the data source contains a specific text string. Looking through the information you pointed me to it seems I can add additional text information etc but there is no example where for example I have dates in my data source but for some reason a date value isnt applicable so we input N/A. This then comes through on the mail merge, but can I set a switch which means that if the Date_required field contains N/A then nothing is displayed? -- Regards Andy Andy Roberts Win XP, Office 2007 "Peter Jamieson" wrote in message ... macropod has an example of this in his Word Date Calculation Tutorial, at: http://lounge.windowssecrets.com/ind...owtopic=249902 or http://www.gmayor.com/downloads.htm#Third_party (He generally says "Do read the document's introductory material.") Last time I looked the example was titled "Insert A Date with Ordinal Numbering" Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 08:43, Andy Roberts wrote: This may not be possible very easily. I have a sentence in a mail merge doc which reads "Thank you for your letter dated 21st August 2009..." with the date being a mail merge field from Excel. The format of the mail merge field is {MERGEFIELD Date Required\@"DD MMMM YYYY"}which gives me 21 August 2010. Is it possible to :- 1. Have the "st" or "th" inserted after the day (i.e 21st or 19th) 2. Have it appear super script like it does if it is typed in word. |
#4
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Peter
I have attached the field code i'm using to deal with the Ordinal which is merging a Merge Field called Date _Received. Everything works ok when it pulls a date which has an Ordinal of "th" eg 25th, 26th etc. However if it pulls a date using "rd" "st" or "nd" then I get a syntax error. The code looks ok to me (but obviously isnt) -- Regards Andy Andy Roberts Win XP, Office 2007 "Peter Jamieson" wrote in message ... macropod has an example of this in his Word Date Calculation Tutorial, at: http://lounge.windowssecrets.com/ind...owtopic=249902 or http://www.gmayor.com/downloads.htm#Third_party (He generally says "Do read the document's introductory material.") Last time I looked the example was titled "Insert A Date with Ordinal Numbering" Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 08:43, Andy Roberts wrote: This may not be possible very easily. I have a sentence in a mail merge doc which reads "Thank you for your letter dated 21st August 2009..." with the date being a mail merge field from Excel. The format of the mail merge field is {MERGEFIELD Date Required\@"DD MMMM YYYY"}which gives me 21 August 2010. Is it possible to :- 1. Have the "st" or "th" inserted after the day (i.e 21st or 19th) 2. Have it appear super script like it does if it is typed in word. |
#5
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
My best guess based on your picture is that you have
rd ;st;nd i.e. with a space after "rd" when you need rd;st;nd (It should be possible to copy/paste the entire field nested field code from macropod's document to yours, then change the name of the date field as necessary). Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 12:02, Andy Roberts wrote: Peter I have attached the field code i'm using to deal with the Ordinal which is merging a Merge Field called Date _Received. Everything works ok when it pulls a date which has an Ordinal of "th" eg 25th, 26th etc. However if it pulls a date using "rd" "st" or "nd" then I get a syntax error. The code looks ok to me (but obviously isnt) |
#6
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Looking through the information you pointed me to it
seems I can add additional text information etc Well, only really if you connect using DDE, which has its problems, including a. you can only get data from the first sheet b. you have to have Excel on the machine (a consideration for some applications but I would guess not yours) c. Word has to start Excel if it's not already running d. On Vista at least, Word sometimes fails to connect to the data source, especially if it is on a network drive Since it was also "deprecated" a long time ago, I've got to the point now where I prefer not to suggest it, but unfortunately there are still plenty of scenarious in which ist's the only good option when working with an arbitrary Excel file. In Word, to select DDE, a. go to Office button-Word options-Advanced-General (near the bottom) and check "Confirm file format conversion on open" b. go through the connection process again. In the dialog titled "Confirm Data Source", with a .xls you should be offered the DDE option. With a .xlsx/.xlsm, you have to check "Show ALl" and look down the list. Then it's typically a question of either putting exactly what you want in the worksheet, or if necessary using IF fields to detect specific non-date values in the worksheet (e.g. blank) and replacing it with the value you want. There are other possible ways to do this, but they are more likely to require you to modify your approach in Excel or to copy/paste your data into a new Word document and use that as your data source. I realise your other questions have a bearin gon all this, but right now I'll try to answer them in isolation. Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 11:51, Andy Roberts wrote: Peter this is exactly what I needed once I managed to get my head around it - thank you ever so much Can I have the merge field display blank when the data source contains a specific text string. Looking through the information you pointed me to it seems I can add additional text information etc but there is no example where for example I have dates in my data source but for some reason a date value isnt applicable so we input N/A. This then comes through on the mail merge, but can I set a switch which means that if the Date_required field contains N/A then nothing is displayed? |
#7
![]()
Posted to microsoft.public.word.mailmerge.fields
|
|||
|
|||
![]()
Thanks Peter that has sorted it. In fairness it seemed obvious when you
pointed it out but I'd got to the point of not being able to see the wood for the trees -- Regards Andy Andy Roberts Win XP, Office 2007 "Peter Jamieson" wrote in message ... My best guess based on your picture is that you have rd ;st;nd i.e. with a space after "rd" when you need rd;st;nd (It should be possible to copy/paste the entire field nested field code from macropod's document to yours, then change the name of the date field as necessary). Peter Jamieson http://tips.pjmsn.me.uk On 25/03/2010 12:02, Andy Roberts wrote: Peter I have attached the field code i'm using to deal with the Ordinal which is merging a Merge Field called Date _Received. Everything works ok when it pulls a date which has an Ordinal of "th" eg 25th, 26th etc. However if it pulls a date using "rd" "st" or "nd" then I get a syntax error. The code looks ok to me (but obviously isnt) |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Open Calendar to Specific Date | Microsoft Word Help | |||
Change date format for Comments and display date in balloons | Microsoft Word Help | |||
Insert Date in Specific Format in Mail Merge | Mailmerge | |||
Specific formatting of the date | New Users | |||
Date issue merging from Excel field in Date format to Word | Mailmerge |