Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Word 2000/2002 Bookmarks in Header/Footer 1

Status
Not open for further replies.

SkipVought

Programmer
Dec 4, 2001
47,492
US
Hi Gang!

I am trying to bookmark data items in the header and footer. Trouble is, when I attempt to use the GOTO function, the bookmarks in the header & footer are not listed.

HOWEVER, if I activate the Insert Bookmarks window and use the GOTO in the Bookmark window, the header, footer & body bookmarks are all listed.

I am trying to find a method to find and replace data elements in header, footer & body. I can do it by doing a Find & Replace of a string in a template, but I was trying to see if the bookmark method would work somehow.

Any suggestions? [spineyes]

Skip Skip,
SkipAndMary1017@mindspring.com
 
Hi Skip

I might be missing the point here but have you tried:

If activedocument.bookmarks.exists ("BookMark_Name") then
activedocument.bookmarks("BookMark_Name").select
selection....(whatever)
End If

This should find bookmarks (including hidden) wherever they may lurk, provided you know the name. If the worst came to the worst you could always open up the Header/Footer and search through the Selection.Range property

Still not sure that this is what you want, but hope it helps

asjeff
 
asjeff,

Thanx! Just what I needed. I am a babe in the woods with Word VBA and had used another method that did not work. Yours does.

I am much more proficient in Excel, thanks in part to reference books like those written by John Walkenbach. Can you recomnmend any good reference material for Word VBA?

Much appreciated! And a star for your helpful and expert posting! :) Skip,
SkipAndMary1017@mindspring.com
 
Skip

flattery will get you everywhere and stars even further. My main reference books are:

Title: Word 2000 Developer's Handbook
Author: Guy Hart-Davis
Publisher: Sybex
ISBN: 0-7821-2329-5
(This is a general reference book that contains quite a lot of examples, but as far as coding goes is quite basic.)


Title: VBA Developer's Handbook
Author: Ken Getz & Mike Gilbert
Publisher: Sybex
ISBN: 0-7821-1951-4
(This is for much heavier & more in-depth VBA book but has, at times, certainly come in useful for my Word VBA, but don't buy it specifically for Word Programming - it's too advanced for that.)

And finally I have to admit that probably my primary source of info is the Word VBA Microsoft Help files (press F1 and all that). Also don't be scared of using the macro recorder as this can save you hours, but you will have to clean the resultant code up as the recorder includes every last bit of info and a lot of it is unnecessary for your needs.

Feel free to contact me if you need more help.

Cheers
Asjeff
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top