Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 10-13-2013, 04:48 PM
macropod's Avatar
macropod macropod is offline Yes/No field does not work in mailmerge Windows 7 32bit Yes/No field does not work in mailmerge Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by Abacus1234 View Post
I had to change the mail merge data transfer method and dump the contents of the query into a text file. The text file does not carry formatting for date/time, currency or support this If statement.
Text & currency formatting can be controlled from within Word, via the use of formatting switches in the fields.

Mailmerge Number & Currency Formatting
To control number & currency formatting in Word, add a numeric picture switch to the mergefield. To do this:
• select the field;
• press Shift-F9 to reveal the field coding. It should look something like {MERGEFIELD MyData};
• edit the field so that you get {MERGEFIELD MyData \# $,0.00} (or whatever other numeric format you prefer - see below);
• position the cursor anywhere in this field and press F9 to update it;
• run your mailmerge.

Note1: The '\# $,0.00' in the field is referred to as a numeric picture switch. Other possibilities include:
• \# 0 for rounded whole numbers
• \# ,0 for rounded whole numbers with a thousands separator


• \# ,0.00 for numbers accurate to two decimal places, with a thousands separator
• \# $,0 for rounded whole dollars with a thousands separator
• \# "$,0.00;($,0.00);'-'" for currency, with brackets around negative numbers and a hyphen for 0 values
The precision of the displayed value is controlled by the '0.00'. You can use anything from '0' to '0.000000000000000'.

If you use a final ';' in the formatting switch with nothing following, (eg \# "$,0.00;($,0.00);") zero values will be suppressed. Note that this suppresses 0s resulting from empty fields and from fields containing 0s.
Note2: If you use a decimal tab or right-aligned tab to align the values and insert a tab into the field code after the $ sign, you can have the values aligned accordingly.

Mailmerge Date Formatting
To get the date format you want, you can add a formatting picture switch as follows:
• select the mergefield;
• press Shift-F9 to expose the field coding. It should look something like {MERGEFIELD MyDate} where 'MyDate' is your mergefield's name;
• delete anything appearing after the mergefield's name and add '\@ "d MMMM yyyy"' to the field, as in {MERGEFIELD MyDate \@ "d MMMM yyyy"}. With this switch your date will come out as '2 August 2008'.
• position the cursor anywhere in this field and press F9 to update it;
• run your mailmerge.

Other possible date formatting switches include:
. \@ "dddd, d MMMM yyyy";
. \@ "ddd, d MMMM yyyy";
. \@ "d MMM yyyy";
. \@ "dd/MMM/yyyy";
. \@ "d-MM-yy".
Note: You can swap the d, M, y expressions around, but you must use uppercase 'M's for months - lowercase 'm's are for minutes.

PS: The data export to the text file may be the cause of the unwanted spaces referred to in your previous posts.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #2  
Old 10-14-2013, 06:37 AM
Abacus1234 Abacus1234 is offline Yes/No field does not work in mailmerge Windows Vista Yes/No field does not work in mailmerge Office 2010 32bit
Novice
Yes/No field does not work in mailmerge
 
Join Date: Nov 2011
Posts: 24
Abacus1234 is on a distinguished road
Default formating in word mergefields

Hi Paul,

Thanks for your help. You have helped me solve two of the more obscure formatting issues.

I appreciate the input.
Reply With Quote
Reply

Tags
mailmerge, yes/no



Similar Threads
Thread Thread Starter Forum Replies Last Post
Merge Word documents using a mailmerge field Concertina Mail Merge 3 02-18-2013 04:12 AM
Yes/No field does not work in mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 8 02-11-2013 04:40 AM
Yes/No field does not work in mailmerge Mailmerge to Email with a mailmerge attachment Baldeagle Mail Merge 13 05-29-2012 02:04 PM
Formula to subtract one month from due date field in reminder field ghumdinger Outlook 1 10-01-2011 12:09 AM
Yes/No field does not work in mailmerge Making the IF field work (not Mail Merge) Caroline Mail Merge 5 04-11-2011 04:17 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 02:14 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft