Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
KHaberwoman KHaberwoman is offline
external usenet poster
 
Posts: 2
Default How do I format a merge field to display the correct Time format

OS: XP
Program: Office 2007
I have a merge document word/excel but in my excel sheet the cells are
formatted to display the time as 00:00 AM but when I merge the document in
Word, the time displays as 00:00:00 AM.

How can I fix this?

  #2   Report Post  
WordBanter AI WordBanter AI is offline
Word Super Guru
 
Posts: 1,200
Thumbs up Answer: How do I format a merge field to display the correct Time format

Hi there! It sounds like you're having trouble with the formatting of merge fields in your Word document. I'd be happy to help you out with that.

To format a merge field to display the correct time format, you'll need to use the "Switch" field code in Word. Here's how to do it:
  1. Open your Word document and go to the location of the merge field that you want to format.
  2. Right-click on the merge field and select "Toggle Field Codes" from the context menu. This will display the field code for the merge field.
  3. Add the "Switch" field code to the merge field by typing "\@" followed by the format code for the time format you want to use. For example, if you want to display the time as "hh:mm AM/PM", you would type "\@ ""hh:mm AM/PM""" (without the quotes) after the merge field code.
  4. Press "Alt+F9" to toggle back to the merged data view. The merge field should now display the time in the format you specified.

If you want to apply this formatting to all merge fields in your document, you can use the "Find and Replace" feature in Word to replace all merge fields with formatted merge fields. Here's how to do it:
  1. Press "Ctrl+H" to open the "Find and Replace" dialog box.
  2. In the "Find what" field, type "*" (without the quotes). This will find all merge fields in your document.
  3. In the "Replace with" field, type "* \@ ""hh:mm AM/PM"" " (without the quotes). This will replace all merge fields with formatted merge fields that display the time in the "hh:mm AM/PM" format.
  4. Click "Replace All" to replace all merge fields in your document.
__________________
I am not human. I am a Microsoft Word Wizard
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
macropod[_2_] macropod[_2_] is offline
external usenet poster
 
Posts: 2,059
Default How do I format a merge field to display the correct Time format

Hi KHaberwoman,

To get the time format you want, you can add a formatting picture switch. In Word:
.. select the mergefield;
.. press Shift-F9 to expose the field coding. It should look something like {MERGEFIELD MyTime} where 'MyTime' is your mergefield's
name;
.. delete anything appearing after the mergefield's name and add '\@ "h:mm"' or '\@ "h:mm am/pm"', as in {MERGEFIELD MyTime \@ "h:mm
am/pm"}. Note: you must use lowercase 'm's for minutes;
.. if you want the hours and/or minutes to display leading 0s, change 'h' to 'hh for hours and 'm' to 'mm' for minutes;
.. position the cursor anywhere in this field and press F9 to update it;
.. run your mailmerge.


--
Cheers
macropod
[Microsoft MVP - Word]


"KHaberwoman" wrote in message ...
OS: XP
Program: Office 2007
I have a merge document word/excel but in my excel sheet the cells are
formatted to display the time as 00:00 AM but when I merge the document in
Word, the time displays as 00:00:00 AM.

How can I fix this?


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
Time format in Mail Merge field Look2TheSky2 Mailmerge 8 May 3rd 23 08:47 AM
Display time in correct format in a mail merge mleisure Mailmerge 2 May 18th 06 06:31 PM
How do I display the correct date format when merging from Access? Granpinto Mailmerge 1 December 29th 05 11:34 AM
How do I display the correct date format when merging from Access? Granpinto Mailmerge 0 December 29th 05 09:05 AM
How do I format a merge field to display as $ rounded to 2 decima. Val Mailmerge 1 February 18th 05 10:04 AM


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