I have recorded a macro to save my files to a shared folder on my computer. Only issue being that when I use this on a new document it saves with the same file name and overwrites the document already saved. I want it to save the file with the original file name rather than the one used when recording the macro.
ChangeFileOpenDirectory "O:\Team NF CV's\"
ActiveDocument.SaveAs2 FileName:="O:\Team NF CV's\Jaumns.docx", FileFormat _
:=wdFormatXMLDocument, LockComments:=False, Password:="", _
AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _
EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _
:=False, SaveAsAOCELetter:=False, CompatibilityMode:=14
End Sub
It is the second line down where it uses the filename Jaumns.docx rather than the original unique file name.
Any help appreciated.
| Title | Under | Posted on |
|---|---|---|
| Required Peoplesoft HRMS Functional Training | PeopleSoft Functional | 05/07/2013 - 10:29pm |
| Error while saving Voucher | PeopleSoft Functional | 05/02/2013 - 1:55am |
| santosh asking que | PeopleSoft Technical | 04/30/2013 - 10:22am |
| How can i implement Email functionality to alerts in peoplesoft. | PeopleSoft Technical | 04/30/2013 - 5:01am |
ActiveWorkbook.Name will give you the name of the workbook. So try the below
Change line FileName:="O:\Team NF CV's\Jaumns.docx" to FileName:="O:\Team NF CV's\" + ActiveWorkbook.Name
Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog