|
-
Apr 15th, 2003, 09:01 AM
#1
Thread Starter
Addicted Member
Ms Word and Sections in VB
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
-
Apr 15th, 2003, 09:25 AM
#2
You can bookmark it and then go to that bookmark.
"It's cold gin time again ..."
Check out my website here.
-
Apr 15th, 2003, 09:28 AM
#3
Thread Starter
Addicted Member
Thanks Bruce I will give it a go tonight.
I will scream for help if I dont understand tomorrow
Simon
-
Apr 15th, 2003, 09:48 AM
#4
You don't need a bookmark.
VB Code:
Dim myRange As Word.Range
Set myRange = Application.ActiveDocument.GoTo(What:=wdGoToSection, Which:=wdGoToFirst, Count:=2, Name:="")
myRange.Select
Set myRange = Nothing
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 object
-
Apr 15th, 2003, 09:52 AM
#5
Thread Starter
Addicted Member
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
-
Apr 15th, 2003, 09:59 AM
#6
I don't think a section has a name.
-
Apr 15th, 2003, 10:03 AM
#7
Thread Starter
Addicted Member
I am probably not being clear
if I have a word document with ......................
ahh the penny drops, I am being a bit stupid here
I meant a heading (I was thinking of how they look in a TOC)
Sorry
Simon
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|