Quote:
Originally Posted by slaycock
The problem seems to relate to the wdLine constant
|
Indeed it is. Note how in post #3 you used:
Set myRange = ActiveDocument.Content.GoTo(what:=wdLine, which:=wdGoToAbsolute, Count:=6)
(as per the MS doco), whereas in post #5 I used:
Set myRange = ActiveDocument.Range.GoTo(What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=6)
That gets myRange to the start of line 6 and, according to MS:
Set myRange = myRange.GoTo(What:=wdGoToBookmark, Name:="\line")
should expand myRange to span the whole line. It's results are inconsistent, however, and often fails to span the entire line.