View Single Post
 
Old 09-18-2017, 11:34 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,338
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Quote:
Originally Posted by slaycock View Post
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.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote