+ Reply to Thread
Results 1 to 2 of 2

Merge file formatting

  1. #1
    Forum Contributor
    Join Date
    03-08-2007
    Location
    St. Augustine, Fl
    MS-Off Ver
    Excel 2021 for Mac
    Posts
    392

    Merge file formatting

    I am merging an Excel file into a form and need the dates to be (example,(Decemeber 16, 2007 or what ever the date is in the field)). I have them formatted in Excel as dates with the MMMM D, YYYY and it shows that in the file. However, on the form it shows 12/16/2007. Is there and easy fix for this?

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,726

    Re: Merge file formatting

    Word has a number of different methods of connecting to mail merge data sources, including DDE and OLE DB. Word 2002 and later use the OLE DB connection by default, though you can change this (to DDE, for example). To work around a limitation in the OLE DB provider used to get data from Excel etc., when Word is connected to an OLE DB data source, it treats dates as if they are in the US mm/dd/yyyy format, regardless of the format in Excel, your regional settings etc. Applying a date format switch fixes that - and gives the mailmerge document the ability to format the date independently of whatever format is used in the data source.

    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 '\@ "MMMM D, YYYY"' to the field, as in {MERGEFIELD MyDate \@ "MMMM D, YYYY"}. With this switch your dates will come out like 'August 2, 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.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 2
    Last Post: 01-22-2013, 11:37 AM
  2. Replies: 0
    Last Post: 11-03-2012, 09:10 PM
  3. 4folders, 4files (file names change weekly) merge into one master file, as needed
    By alkangirl in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-01-2012, 08:28 PM
  4. Merge Highlighted Cells to create file name for Scanned File
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-01-2010, 12:27 PM
  5. merge old excel file with new file?
    By fireski77 in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-22-2008, 08:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1