I have a word document that i need to duplicate 200 times with the filename ending in consecutive numbers.
file1
file2
file3....file200
thanks
I have a word document that i need to duplicate 200 times with the filename ending in consecutive numbers.
file1
file2
file3....file200
thanks
Try something based on:
If you need to prefix the number with some text, simply add that after the '\' in:Sub Make200() Application.ScreenUpdating = False Dim i As Long, StrPath As String, StrExt As String, lFmt As Long With ActiveDocument StrPath = .Path & "\": lFmt = .SaveFormat StrExt = "." & Split(.Name, ".")(UBound(Split(.Name, "."))) For i = 1 To 200 .SaveAs2 FileName:=StrPath & Format(i, "000") & StrExt, _ Fileformat:=lFmt, AddToRecentFiles:=False Next End With Application.ScreenUpdating = True End Sub
StrPath = .Path & "\"
Note: The code assumes the active document is the one you want to replicate.
Cheers
Paul Edstein
[Fmr MS MVP - Word]
Thank you!
Does exactly what I wanted.