|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Macro to create new word doc and save the file using String found in the document
Hello world!
I'm BRAND spanking new here and to VBA for Word. I am fairly well versed in Excel VBA, but I have run into a situation where I need to automate something via Word and am looking for a little guidance. I have a document that has a list of names. I need to create a new Word document for each of these names and save the file as that person's name, with only that person on it. So I need the macro to not only create and save the document with that person's name, I need it to delete every other name in the list...in short, 1 person on each document. Where would I begin here? Can this be accomplished in Word or am I going to need to figure out an Excel solution? (which would be pretty simple, but ultimately we'd like to have these documents in Word) |
#2
|
||||
|
||||
If these documents are to have any content other than just the name, I'd suggest using your list as a mailmerge data source for a letter merge. That will produce a file with one page per entry, separated by Section breaks. You could then use a macro to split the output into separate files. For some examples of that, see: https://www.msofficeforums.com/mail-...ttachment.html
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
Thanks for the reply and the link. I will look into this this weekend. I anticipate I'll be back
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Bad view when using Find and Find & Replace - Word places found string on top line | paulkaye | Word | 4 | 12-06-2011 11:05 PM |
A newbie question: a must to save macro word file as .docm? | tinfanide | Word VBA | 6 | 12-06-2011 03:02 PM |
Macro VBA "Save as" with bookmarks in file name string | Dom37 | Word VBA | 2 | 10-31-2011 03:28 AM |
Word Macro: Save file as text with current file name | jabberwocky12 | Word VBA | 2 | 10-22-2010 12:23 PM |
Macro will not save to normal.dot file when exiting | bobbraun | Word | 1 | 09-28-2010 06:26 AM |