Hi I have searched for this but cannot find it anywhere.
I have opened a word file from my VB program, but ........
I want to go straight to a given section ?
any ideas ?
Simon
Printable View
Hi I have searched for this but cannot find it anywhere.
I have opened a word file from my VB program, but ........
I want to go straight to a given section ?
any ideas ?
Simon
You can bookmark it and then go to that bookmark.
Thanks Bruce I will give it a go tonight.
I will scream for help if I dont understand tomorrow
Simon
You don't need a bookmark.
Make sure that you either replace Application with your object variable for the application object, or replace Application.ActiveDocument with your object variable for the document objectVB Code:
Dim myRange As Word.Range Set myRange = Application.ActiveDocument.GoTo(What:=wdGoToSection, Which:=wdGoToFirst, Count:=2, Name:="") myRange.Select Set myRange = Nothing
Thanks Frans
I was playing with that yesterday, but could not get it to work.
I will get it tonight though !!!!
the
wdgotofirst
can I use a text name ie 'My Section Title' or must I use number
Simon
I don't think a section has a name.
I am probably not being clear
if I have a word document with ......................
ahh the penny drops, I am being a bit stupid here :rolleyes:
I meant a heading (I was thinking of how they look in a TOC)
Sorry
Simon