Skip to main content

Choose-a-Line

Command Description

Select the specified range of line in a Word document

Command Prototype

Word.SelectRow(objWord,iStart,iEnd)

Parameter Description

ParameterRequiredTypeDefaultDescription
objWordTrueexpressionobjWordWord document object
iStartTruenumber1Select the starting line of a document area, starting from 1
iEndTruenumber1Select the ending line of a document area, starting from 1

Demo

/************************************Select row************** ************************ 
Command prototype:
Word.SelectRow(objWord,iStart,iEnd)
Input parameters:
objWord--Word document object
iStart--Select the starting line of the document range, starting from 1
iEnd--selects the end line of the document range, starting at 1
*********************************************************************************/
Dim objWord
objWord = Word.Open('''C:\Users\Administrator\Desktop\Standardization Implementation Notes.docx''',"xw4131221","",true)
sRet = Word.ReadAll (objWord)
TracePrint ($ PrevResult)
Word.SelectRow(objWord,1,1)