+ Reply to Thread
Results 1 to 2 of 2

Automating Mail Merge with Macro

  1. #1
    Registered User
    Join Date
    04-05-2016
    Location
    Philadelphia, Pennsylvania
    MS-Off Ver
    Microsoft Office Professional Plus 2013
    Posts
    40

    Automating Mail Merge with Macro

    Hi All,

    I have a mail merge set up between an excel doc and a word doc. I would like to use the excel info to populate the word document, but want to be able to select which row to populate it with. I have the mail merge set up, and I have a macro written to create an Input Box asking for a Booking Number which will then pull over the relevant info. It works, but only for the first row of the excel document and I'm not sure why that is. Below is the macro I presently have written


    Please Login or Register  to view this content.
    Attached Files Attached Files

  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: Automating Mail Merge with Macro

    Aside from the fact your VBA code doesn't set the merge record correctly and never executes the merge, you don't actually need VBA for this. In any event, being a docx file, your mailmerge main document cannot contain a macro. All you need is an appropriately-coded SKIPIF field in the mailmerge main document. See attached.
    Attached Files Attached Files
    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: 5
    Last Post: 11-15-2018, 10:54 PM
  2. Mail Merge - Merge fields lister macro
    By adil.master in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-26-2015, 10:33 AM
  3. Replies: 0
    Last Post: 01-05-2015, 07:35 AM
  4. Automating Mail Merge with VBA
    By linuxgeek in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-12-2014, 03:30 PM
  5. Replies: 2
    Last Post: 07-12-2012, 08:11 PM
  6. Macro to run mail merge?
    By carlosbourn in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-15-2008, 08:41 AM
  7. Error - automating mail merge through word
    By Josh_123456 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-29-2007, 03:46 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