![]() |
#1
|
|||
|
|||
![]()
I need to create around 150 .docx files, for use as placeholders in a document management system. What's the easiest way to achieve this? I already have a list of the filenames we will be using.
Last edited by Charles Kenyon; 02-26-2015 at 09:29 AM. Reason: Mark as solved |
#2
|
||||
|
||||
![]()
Create one such document, then add a macro using a SaveAs loop to it, to save the 150 copies, using your list for the filenames. For example:
Code:
Sub ReplicateMe() Dim i As Long, StrPath As String, ArrNames() ArrNames = Array("Document 1", "Document 2", "Document 3", "Document 4", "Document 5", "Document 6", "Document 7") With ActiveDocument StrPath = .Path & "\" For i = 0 To UBound(ArrNames) .SaveAs2 FileName:=StrPath & ArrNames(i) & ".docx", Fileformat:=wdFormatXMLDocument, AddToRecentFiles:=False Next End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
thanks, Paul … I think I almost understand that chunk of code :-} now let's see how many mistakes I make trying to run it.
|
#4
|
|||
|
|||
![]()
Poised to give it a try … don't suppose I could read the list of documents from an external file instead of hard-coding it in the macro?
|
#5
|
||||
|
||||
![]()
Yes, that would be possible, but I'd need to know the file format before I could code for it.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#6
|
|||
|
|||
![]()
Sorry for the delay … but I have finally made the time to try out the original macro. Just the job! and I now think I'll be able to manage my tasks better if I stick to the original version with a few hardcoded names.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Deleting Unintended Solid Line in .docx | jwoodbury | Word | 5 | 05-04-2018 07:06 PM |
From the command line, how do I run a Word macro? | jdockstader | Word | 7 | 02-04-2013 06:09 AM |
![]() |
asearle | Word | 1 | 08-07-2012 05:42 AM |
Command Line Argument | xJediDadx | Outlook | 1 | 02-21-2011 03:47 PM |
Command Line Switches | Ringmaster | Office | 0 | 08-10-2010 06:27 AM |