![]() |
|
#1
|
|||
|
|||
![]()
Hello together, when I try to use the function SaveAs2 it fails at trying to create the file new. It only works at overriding an existing document.
I use following code: ActiveDocument.SaveAs2 FileName:=GlobalPath + "\" + GlobalFile, FileFormat _ :=wdFormatXMLDocumentMacroEnabled, LockComments:=False, Password:="", _ AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, _ EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData _ :=False, SaveAsAOCELetter:=False, CompatibilityMode:=wdWord2013 I use Word 2013. Has anyone an idea why this happens? |
#2
|
||||
|
||||
![]()
Provided GlobalPath + "\" + GlobalFile returns a valid path & filename, you could be able to reduce the SaveAs2 command to:
ActiveDocument.SaveAs2 FileName:=GlobalPath + "\" + GlobalFile, FileFormat:=wdFormatXMLDocumentMacroEnabled, CompatibilityMode:=wdWord2013
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Issue solved. I had a wrong code before this code, which tried to Access a non-existing file.
|
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
brian2014 | Excel | 6 | 08-25-2015 08:46 AM |
formula does not work properly | msnarayanan | Excel | 2 | 08-12-2015 12:40 AM |
![]() |
ksigcajun | Word VBA | 6 | 04-06-2015 07:41 AM |
How exactly does the search function work in Excel | pintree3 | Excel | 2 | 01-26-2015 07:24 AM |
![]() |
tinfanide | Word VBA | 6 | 04-18-2012 04:47 AM |