Skip to main content

Write-Text

Command Description

Write texts at the cursor position in a Word document, and replace selected texts if any

Command Prototype

Word.Write(objWord,sText)

Parameter Description

ParameterRequiredTypeDefaultDescription
objWordTrueexpressionobjWordWord document object
sTextTruestring""Write text content

Demo

/************************************Write text ************* **************************** 
Command prototype:
Word.Open(sPath,sAccessPwd,sChangePwd,bVisible)
Input parameters:
objWord--Word document object
sText--write text content
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)
Word.SelectRow(objWord,2,2)
Word.Write(objWord,"zheno")