Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to find nChrPos in Word document for SetRange?
Message
 
 
To
17/02/2007 17:46:49
Donald Lowrey
Data Technology Corporation
Las Vegas, Nevada, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01196857
Message ID:
01196860
Views:
12
After your find, can't you just set your range to Selection.Range()?

Dan

>Good afternoon
>
>How do you find the position of a character in a Word document to set a range, as in: oRange.SetRange(lnStartPos, lnEndPos)
>
>This the scenario. We want to define a Range "begin" and "end" points by searching for a word or string in a Word document. We have already coded the Find stuff and we can find both the begining and end words.
>
>Ok. But now we need to know the integer value which is the character position in the document of the first character of the first word, and the last character of the second FOUND() word.
>
>Here's a snippet that better describes the problem. See the line with "???".
>
>
>oRange.Find.Text = "some string"
>llFound = oRange.Find.Execute()  && This finds the string in the document
>IF llFound
>        && code here to collapse to the begining of the Found() word.
>	lnStartPos = ???    <--- how do we get the character position?
>ENDIF
>
>* code similar to the above lines to find the string which denotes the end postion
>
>oRange.SetRange(lnStartPos, lnEndPos)       && Set the Range
>
>
>Thanks for taking the time to answer.
>
>- Don Lowrey
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform