Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / February 2006

Tip: Looking for answers? Try searching our database.

VB cant find bookmark in Header

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Sukhi - 10 Feb 2006 11:19 GMT
Hello again
I have bookmark in Header, When I try to get to it in VB with the code --

objWord.ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.GoTo What:=wdGoToBookmark, Name:="HeaderPlanName"

I get the error 5678
"Word cannot find the reuested bookmark."

even though the above is generated by word it self (by recording macro).
Help please!!!
You guys have been great so far
Jonathan West - 10 Feb 2006 13:15 GMT
> Hello again
> I have bookmark in Header, When I try to get to it in VB with the code --
[quoted text clipped - 8 lines]
> Help please!!!
> You guys have been great so far

Instead of this

   Selection.GoTo What:=wdGoToBookmark, Name:="HeaderPlanName"

use this

   ActiveDocument.Bookmarks("HeaderPlanName").Range.Select

The Selection.Goto method only works where the bookmark is in the same
storyrange as the selection.

Signature

Regards
Jonathan West - Word MVP
www.intelligentdocuments.co.uk
Please reply to the newsgroup
Keep your VBA code safe, sign the ClassicVB petition www.classicvb.org 

Helmut Weber - 10 Feb 2006 13:51 GMT
Hi,

yes, as Jonathan said,

and in addition, there is hardly a situation,
in which you need to select the bookmark at all.

Signature

Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

Win XP, Office 2003
"red.sys" & Chr$(64) & "t-online.de"

Sukhi - 10 Feb 2006 14:15 GMT
You guys are *s

> Hi,
>
> yes, as Jonathan said,
>
> and in addition, there is hardly a situation,
> in which you need to select the bookmark at all.

Rate this thread:






 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.