Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 02-10-2015, 02:49 PM
macropod's Avatar
macropod macropod is offline create .docx from command line? Windows 7 64bit create .docx from command line? Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
 



Similar Threads
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
create .docx from command line? Command line syntax for 2010 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

Other Forums: Access Forums

All times are GMT -7. The time now is 04:39 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft