Word Mail Merge - Two Issues

User avatar
Carol W.
3StarLounger
Posts: 390
Joined: 26 Jan 2010, 16:02
Location: Las Vegas, NV

Word Mail Merge - Two Issues

Post by Carol W. »

I have a Word mail merge that is generally working quite well. I inserted the following code to have the current date printed on the letter:

Code: Select all

{DATE \@ "MMMM DD, YYYY"}
I have two issues:
1 - There is an extra space coming out before the J in June 02, 2012, IOW as the very first character on the line. How can I eliminate this space?
2 - I would like to suppress the leading zero in 02 if possible. IOW, I would like the date to read June 2, 2012.

I realize that I can edit the final merged document to correct these issues but I would like to learn how to resolve them automatically.

Any help would be greatly appreciated.
Carol W.

User avatar
HansV
Administrator
Posts: 78849
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Word Mail Merge - Two Issues

Post by HansV »

To lose the leading zero in the day number, use

{ Date \@ "MMMM d, yyyy" }

In other words, a single "d" instead of "dd". I don't see where a space before the date would come from, though. Are you sure that there isn't a space before the opening field bracket { ?
Best wishes,
Hans

User avatar
Carol W.
3StarLounger
Posts: 390
Joined: 26 Jan 2010, 16:02
Location: Las Vegas, NV

Re: Word Mail Merge - Two Issues

Post by Carol W. »

Hans,

Substituting the d for DD did the trick on the date.

I'm at a loss as to why the date is preceded by a space so I zipped up the docx and xlsx file (dummy data substituted) and have attached it to this post.

Thanks.
You do not have the required permissions to view the files attached to this post.
Carol W.

User avatar
HansV
Administrator
Posts: 78849
Joined: 16 Jan 2010, 00:14
Status: Microsoft MVP
Location: Wageningen, The Netherlands

Re: Word Mail Merge - Two Issues

Post by HansV »

At 6 places in the document, you have the field code

{ DATE \@ " MMMM d, YYYY " }

Notice the spaces before and after the date format. If you remove those, you should be OK.
Best wishes,
Hans

User avatar
Carol W.
3StarLounger
Posts: 390
Joined: 26 Jan 2010, 16:02
Location: Las Vegas, NV

Re: Word Mail Merge - Two Issues

Post by Carol W. »

Hans,

Thanks. We (My husband (PaulW) and I) had just figured out that the space before MMMM was the culprit!
Carol W.