Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-13-2016, 02:57 AM
Marco Hof Marco Hof is offline Function SaveAs2 does not work properly Windows 10 Function SaveAs2 does not work properly Office 2013
Novice
Function SaveAs2 does not work properly
 
Join Date: Jun 2016
Posts: 2
Marco Hof is on a distinguished road
Default Function SaveAs2 does not work properly


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?
Reply With Quote
  #2  
Old 06-13-2016, 05:51 AM
macropod's Avatar
macropod macropod is offline Function SaveAs2 does not work properly Windows 7 64bit Function SaveAs2 does not work properly Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,962
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 06-13-2016, 07:39 AM
Marco Hof Marco Hof is offline Function SaveAs2 does not work properly Windows 10 Function SaveAs2 does not work properly Office 2013
Novice
Function SaveAs2 does not work properly
 
Join Date: Jun 2016
Posts: 2
Marco Hof is on a distinguished road
Default

Issue solved. I had a wrong code before this code, which tried to Access a non-existing file.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Function SaveAs2 does not work properly Cannot get the IF function to work brian2014 Excel 6 08-25-2015 08:46 AM
formula does not work properly msnarayanan Excel 2 08-12-2015 12:40 AM
Function SaveAs2 does not work properly Code doesnt work properly 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
Function SaveAs2 does not work properly Word VBA: SaveAs2 - An error? tinfanide Word VBA 6 04-18-2012 04:47 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:15 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft