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  

Specific Date Format



 
 
Thread Tools Display Modes
  #1  
Old March 25th, 2010, 09:43 AM posted to microsoft.public.word.mailmerge.fields
Andy Roberts
external usenet poster
 
Posts: 183
Default Specific Date Format

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  
Old March 25th, 2010, 10:44 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Specific Date Format

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  
Old March 25th, 2010, 12:51 PM posted to microsoft.public.word.mailmerge.fields
Andy Roberts
external usenet poster
 
Posts: 183
Default Specific Date Format

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  
Old March 25th, 2010, 01:02 PM posted to microsoft.public.word.mailmerge.fields
Andy Roberts
external usenet poster
 
Posts: 183
Default Specific Date Format

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  
Old March 25th, 2010, 05:22 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Specific Date Format

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  
Old March 25th, 2010, 06:04 PM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Specific Date Format

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  
Old March 25th, 2010, 06:18 PM posted to microsoft.public.word.mailmerge.fields
Andy Roberts
external usenet poster
 
Posts: 183
Default Specific Date Format

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)



 




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 12:12 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.