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

Re: VB cant find bookmark in Header by Jonathan

Jonathan
Fri Feb 10 07:15:23 CST 2006


"Sukhi" <Sukhi@discussions.microsoft.com> wrote in message
news:4B3FC6AB-C380-4F5A-9112-C2DE77114DBC@microsoft.com...
> 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

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.

--
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


Re: VB cant find bookmark in Header by Helmut

Helmut
Fri Feb 10 07:51:46 CST 2006

Hi,

yes, as Jonathan said,

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

--
Greetings from Bavaria, Germany

Helmut Weber, MVP WordVBA

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




Re: VB cant find bookmark in Header by Sukhi

Sukhi
Fri Feb 10 08:15:28 CST 2006

You guys are *s

"Helmut Weber" wrote:

> Hi,
>
> yes, as Jonathan said,
>
> and in addition, there is hardly a situation,
> in which you need to select the bookmark at all.
>
> --
> Greetings from Bavaria, Germany
>
> Helmut Weber, MVP WordVBA
>
> Win XP, Office 2003
> "red.sys" & Chr$(64) & "t-online.de"
>
>
>
>