Set-Cursor-Position
Command Description
Set the cursor position in a word document
Command Prototype
Word.SetPosition(objWord,iMove,optionArgs)
Parameter Description
Parameter | Required | Type | Default | Description |
---|---|---|---|---|
objWord | True | expression | objWord | Word document object |
iMove | True | number | 1 | The number of cursor movements (≥1) |
sType | None | enum | "text" | Object type to control. Options include: "Character", "Row", and "Paragraph". It defaults to "Character" |
Demo
/************************************Set cursor position************ ****************************
Command prototype:
Word.SetPosition(objWord,iMove,optionArgs)
Input parameters:
objWord--Word document object
iMove--The number of times the cursor is moved, starting from 1
sType--the object type of the operation
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)
sRet = Word.ReadAll (objWord)
TracePrint ($ PrevResult)
Word.SetPosition(objWord,4,{"sType":"section"})