Hi Mike,
getting the line number should be easy enough (at least once you know where to look for it
):
[VBA]
MsgBox ActiveDocument.Bookmarks("tm_Test").Range.Information(wdFirstCharacterLineN umber)[/VBA]
or (for the cursor location)
[VBA]
MsgBox Selection.Range.Information(wdFirstCharacterLineNumber)
[/VBA]
Getting the paragraph number is a bit more difficult as there is no such function in Word
:
[VBA]
Function GetParNum(r As Range) As Integer
Dim rParagraphs As Range
Dim CurPos As Integer
r.Select
CurPos = ActiveDocument.Bookmarks("\startOfSel").Start
Set rParagraphs = ActiveDocument.Range(Start:=0, End:=CurPos)
GetParNum = rParagraphs.Paragraphs.Count
End Function
[/VBA]
Call this one the following way for the cursor position:
[VBA] MsgBox GetParNum(Selection.Range)[/VBA]
And for the bookmark:
[VBA]
MsgBox GetParNum(ActiveDocument.Bookmarks("tm_Test").Range)
[/VBA]
Greets
Daniel