+ Reply to Thread
Results 1 to 3 of 3

Word/ExcelMail Merge, only show dates on documents if a value is specified.

  1. #1
    Registered User
    Join Date
    12-02-2015
    Location
    Peterborough, England
    MS-Off Ver
    2007
    Posts
    19

    Word/ExcelMail Merge, only show dates on documents if a value is specified.

    I've encountered a frustrating issue with my mail merge. Essentially, one of my fields is titled "next_letter_date" which will be populated from an Excel data source with the date we next intend to correspond with someone, where applicable.

    In instances where no date needs to be added, my intention was to leave this field blank and my Excel formulae have been set-up to populate these cells with blank i.e, =""

    Instead of blanks the fields are defaulting to today's date!

    This is the last remaining issue for me to overcome before I an start merging so any assistance would be greatly appreciated (pulling my hair out at the moment).



    PS - DDE Connection isn't an option here.

  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: Word/ExcelMail Merge, only show dates on documents if a value is specified.

    I'm not able to reproduce that behaviour, regardless of whether the date field is left blank or has a blank inserted by a formula.

    That said, you should be able to work around the issue with a field in the mailmerge main document coded as either:
    {IF{MERGEFIELD next_letter_date \@ YYYYMMDD}={DATE \@ YYYYMMDD} "" {MERGEFIELD next_letter_date}}
    or:
    {IF{MERGEFIELD next_letter_date}<>"" {MERGEFIELD next_letter_date}}

    Note: The field brace pairs (i.e. '{ }') for the above example are all created in the document itself, via Ctrl-F9 (Cmd-F9 on a Mac); you can't simply type them or copy & paste them from this message. Nor is it practical to add them via any of the standard Word dialogues. The spaces represented in the field construction are all required.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    12-02-2015
    Location
    Peterborough, England
    MS-Off Ver
    2007
    Posts
    19

    Re: Word/ExcelMail Merge, only show dates on documents if a value is specified.

    Hi Macropod,

    Thank you for your reply, having tried both options, the first partially worked but the second replaced the date with 12:00:00am in instances where the cells were blank.

    In the end I opted for a dirty workaround and added a hidden column to excel which converted the dates to text which appears to have resolved things.

+ 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. Excel/Word Mail Merge, saving as individual documents using two mergefields as name
    By flakjack in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-01-2016, 12:34 PM
  2. Replies: 0
    Last Post: 09-11-2015, 09:11 AM
  3. [SOLVED] Macro for mail merge and save as word documents
    By aganesan99 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-23-2013, 09:16 AM
  4. Macro to merge Excel information and Word documents?
    By danb1985 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2010, 06:14 PM
  5. How to merge excel and word documents
    By jacqueline in forum Excel General
    Replies: 1
    Last Post: 03-27-2006, 08:52 PM
  6. [SOLVED] can I merge documents in excel like I can in Word
    By kaykayIT in forum Excel General
    Replies: 3
    Last Post: 11-09-2005, 10:00 PM
  7. how do I use mail merge in excel for word documents
    By Lisa J Duffy in forum Excel General
    Replies: 1
    Last Post: 08-04-2005, 09:05 AM

Tags for this Thread

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