I'm trying to automatically save files in a specified folder.
Like having ResultTest1
, ResultTest2
, ResultTest3
, and so forth.
Dim savedName As String
Dim arNames() As String
Dim myCount As Integer
savedName = Dir$("D:\Users\tmp4jj\Desktop\ComparisonTool\ResultTest*.docx")
Do Until savedName = ""
myCount = myCount + 1
ReDim Preserve arNames(1 To myCount)
arNames(myCount) = savedName
savedName = Dir$
Loop
I've been trying out this code but I'm not sure if it'll actually work. Also, I tried recording a macro where I changed the options of the saved file's destination beforehand. These codes popped out, not exactly sure if it'll help.
ActiveDocument.SaveAs2 FileName:="ResultTest.docx", FileFormat:= _
wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles _
:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts _
:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=14