Skip to main content

Save-Document-as

Command Description

Save a Word document to a folder

Command Prototype

Word.SaveAs(objWord,sPath,optionArgs)

Parameter Description

ParameterRequiredTypeDefaultDescription
objWordTrueexpressionobjWordWord document object
sPathTruepath'''C:\Users'''The file directory to save as to. The suffix can be .doc, .docx, .txt, .csv etc
fileFormatNoneenum16The format in which the document is saved

Demo

/************************************Save document as ************* **************************** 
Command prototype:
Word.SaveAs(objWord,sPath,optionArgs)
Input parameters:
objWord--Word document object
sPath--saved file directory, the suffix can be .doc, .docx, .txt, .csv , etc.
fileFormat--The format in which the document is saved
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)
Word.SelectRow(objWord,3,6)
Word.SetFontStyleEx(objWord,False,true,1)
Word.SaveAs(objWord,'''C:\Users\Administrator\Desktop\ddd''',{"fileFormat": 16})