![]() |
|
#1
|
||||
|
||||
![]()
Yes, the Word doco on this is lacking. You could use:
Code:
Sub Test() Dim myRange As Range Set myRange = ActiveDocument.Range.GoTo(What:=wdGoToLine, Which:=wdGoToAbsolute, Count:=6) Set myRange = myRange.GoTo(What:=wdGoToBookmark, Name:="\line") myRange.Select End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
|||
|
|||
![]()
Your code seems to select line 6 OK for me.
I followed the help at https://msdn.microsoft.com/VBA/Word-...to-method-word The problem seems to relate to the wdLine constant as Code:
Set myRange = ActiveDocument.StoryRanges(wdMainTextStory).Characters(1) myRange.MoveEnd unit:=wdWord myRange.MoveEnd unit:=wdLine |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
seyzna | Word | 7 | 05-22-2023 10:57 AM |
![]() |
wblock@cnu.edu | Word | 4 | 08-23-2017 06:11 PM |
![]() |
mssodium1219 | Word | 3 | 04-01-2015 04:24 AM |
![]() |
paulkaye | Word | 4 | 12-06-2011 11:05 PM |
Word 2003 cuts the last line of my document off | wordboy9317 | Word | 0 | 10-12-2009 08:44 AM |