Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andy Roberts Andy Roberts is offline
external usenet poster
 
Posts: 24
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andy Roberts Andy Roberts is offline
external usenet poster
 
Posts: 24
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andy Roberts Andy Roberts is offline
external usenet poster
 
Posts: 24
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
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   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Andy Roberts Andy Roberts is offline
external usenet poster
 
Posts: 24
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)



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
Open Calendar to Specific Date Ben Microsoft Word Help 2 June 11th 09 06:21 PM
Change date format for Comments and display date in balloons Melissa Microsoft Word Help 13 January 30th 06 04:21 PM
Insert Date in Specific Format in Mail Merge a_ryan1972 Mailmerge 2 August 25th 05 03:52 PM
Specific formatting of the date Wowbagger New Users 3 August 2nd 05 11:46 PM
Date issue merging from Excel field in Date format to Word Barb Reinhardt Mailmerge 1 December 17th 04 07:34 AM


All times are GMT +1. The time now is 03:47 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"