Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Finding current cursor position in MS Word. Coding in Visual Basic 1

Status
Not open for further replies.

gem28

Instructor
Nov 5, 2001
64
0
0
PH
I am currently programming using the Visual Basic Editor in MS Word. I recorded several macros so just so I can insert the SEQ numbering on a paragraph.

However, I need to know how I can find the returned value of the current cursor position because I search for the section mark first and I want the cursor to return to the line that I first clicked on before inserting the SEQ num.

Is this possible? Please help me. I need this badly.

Thank you very much!

ConsVbGem28
 
noto sure on cursor postion, maybe be look at the goto doobrie in word but...

heres another way when you start your code add in a book mark and then when you finished just go back to that bookmark

Sub Bob()

Dim x

x = Selection.Bookmarks.Add("TEMP")


End Sub

Sub gotobob()

ActiveDocument.Bookmarks("TEMP").Select


End Sub
 
Thanks! :> That is very helpful. I hope you don't mind another question, when you do this, we need to refresh the system into removing the bookmark so that the next time I click on another line in word, it's going to replace it with that.

Thanks again! :)

Cons...
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top