Thread: [Solved] VBA Novice
View Single Post
 
Old 07-02-2018, 10:45 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

You could change the section in the code to


Code:
With Dialogs(wdDialogFileSaveAs)
     .Name = "V:\Inspections\2018\" & strName
     .Show
 End With
or you could replace that with

Code:
ActiveDocument.SaveAs2 "V:\Inspections\2018\" & strName
which will save the file without displaying the dialog, but it will overwrite an existing file of the same name and will crash if the folder doesn't exist.


You will find CreateFolders and FileNameUnique code on my web site to overcome these issues.
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote