+ Reply to Thread
Results 1 to 4 of 4

Macro to break files and save with a specific word in the document.

  1. #1
    Registered User
    Join Date
    06-07-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    66

    Exclamation Macro to break files and save with a specific word in the document.

    I am performing a Mail Merge with Word 2007 and Excel 2007 where the excel has multiple records which creates a huge word document.

    The number of pages of each document can vary depending upon the increase and decrease of paragraphs hence i thought of adding a special character at the end of each document which would help us find the end of 1 document.

    I am trying to search a macro that can break the word document into multiple documents by identifying a special character eg. "@/&/@/&" and then save each document with the invoice number thats available in the document.

    Can someone please help me find a suitable code with explanation....

    Your time is appreciated.

    Regards,
    Adi.

  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: Macro to break files and save with a specific word in the document.

    You could, of course, drive the process with a macro that saves each record as a separate file... For example:
    Please Login or Register  to view this content.
    The above code assumes your datasource contains fields named "Last_Name" & "First_Name" and saves the output with those names in whatever folder you select. You can, of course, choose whatever field(s) you like for the filenames - or even just a counter.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    Registered User
    Join Date
    06-07-2012
    Location
    India
    MS-Off Ver
    Excel 2007
    Posts
    66

    Re: Macro to break files and save with a specific word in the document.

    Hi Paul,

    Thank you for your time. Being a begginer in Macros I had a few queries...

    - Do I need to enter this Macro in MS Word Module or MS Excel Module?
    - Do I need to run the macro post the mail merge is completed?

    Your time is appreciated.
    Regards.

  4. #4
    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: Macro to break files and save with a specific word in the document.

    It's a Word macro and it runs the merge (i.e. you use it instead of the merge 'Finish' process).Your mailmerge main document still needs all the normal mailmerge setup, though.

+ 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. Trying to save a Mail Merge word Document to a specific folder
    By jtemp57 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-19-2014, 06:56 PM
  2. How to save word document on Sharepoint - VBA macro
    By MoneyPenny in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-04-2013, 10:31 AM
  3. Replies: 0
    Last Post: 07-11-2013, 02:08 AM
  4. Replies: 3
    Last Post: 03-30-2006, 12:10 PM
  5. [SOLVED] Open a specific Word document from an Excel Macro
    By Canoeist in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-22-2005, 03:06 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