Results 1 to 6 of 6
  1. #1
    DRob
    Guest

    Bookmark in Header

    I am using Word 97 and trying to add a bookmark to the Header. However, rather than adding the bookmark to the Header, the contents of the bookmark is added to the 1st line of my text. Ideally, I only want this bookmark to appear for 2 thru n pages of the document. When I attempt to do this the bookmark text is added somewhere in the middle of the text.

    I have read hundreds of posts and many websites and the only thing that I have seen on this topic is that adding a bookmark to a header works in Word 97 and up. Am I missing something? Any help would be greatly appreciated.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmark in Header

    Hi DRob:

    There are a couple of things to check.

    1. Are you sure that you're adding the bookmark to the header? i.e. does it appear on every single page, the way a header does. Are you opening the header from View/Header and Footer?

    2. Are you sure that it's not in the header? Is it because it's only on the first page that you say it's not in the header?

    If those two things don't track down the problem, then perhaps you could say exactly what you're doing to insert the bookmark into the header.

  3. #3
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Bookmark in Header

    See <A target="_blank" HREF=http://www.addbalance.com/usersguide/sections.htm>Understanding Headers, Footers, Sections and Section Breaks</A>(http://www.addbalance.com/usersguide/sections.htm)
    Charles Kyle Kenyon
    Madison, Wisconsin

  4. #4
    DRob
    Guest

    Re: Bookmark in Header

    Thanks Phil and Charles for the replies.

    Phil - The answer to question #1 is: Yes, I am opening the header from View/Header and Footer.
    #2. Yes, I am sure it is not in the Header.

    I also reviewed the FAQ that Charles provided.

    Here is some more info. My template is accessed from a VB app that uses Oracle as the database. My template retrieves values from the database to populate a newly created letter (this works fine in the body of the letter). For example, the first line of the letter uses a bookmark to display an address (which is pulled from the DB). For example,

    123 Main Street

    When I add my bookmark in the header (it is supposed to display a case # only when printed), the first line in the letter now looks like this:

    123 Main St1234567eet

    Ultimately, I only want this case # displayed on pages 2 thru N, which I should be able to achieve thru using the Different First Page option (I think). However, when I added my bookmark to the Header on the 2nd page (with the Bookmark removed from Page 1's header), the case # is just added to the middle of the letter text.

    Once again I appreciate any assistance and I hope this clears up to some degree the problem I am having.

    Thanks, Derek

  5. #5
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Bookmark in Header

    I'm not clear on the use you are making of bookmarks. Are you placing these in your template so that you can GoTo the bookmark with VBA and then paste static text? If so, the results you are describing are pretty mysterious.

    Assuming that you have a macro that gives you full control over how the data is deliver into the document, you have some other options, including creating custom document properties and embedding DOCPROPERTY fields in your document to retrieve the information, and then updating them with the actual data.

  6. #6
    Silver Lounger Charles Kenyon's Avatar
    Join Date
    Jan 2001
    Location
    Sun Prairie, Wisconsin, Wisconsin, USA
    Posts
    2,049
    Thanks
    124
    Thanked 119 Times in 116 Posts

    Re: Bookmark in Header

    To do your VBA code you need to simply record the macro.
    I assume that you are accessing a template rather than starting from a blank document. (It doesn't matter which but you have to start somewhere.)

    If your template is not already set up for different header/footer on the first page don't change anything yet.

    Again, we haven't started recording yet. You are in a new document (just like your program will be).

    You have inserted the number you need in a bookmark named MyBookmark.

    Start recording.
    View => Header & Footer...
    Insert => Cross-Reference => Bookmark "MyBookmark"
    Close Header/Footer

    File => Page Setup => Layout (tab)
    Headers and Footers - Different first page (you just pushed your header into the second and subsequent pages).
    OK

    Stop Recording.
    Use the VBA Editor to clean up your code.

    I guess if it were me, I would use a special template for this that already is set up, has the bookmarks, and the REF field that we just built already in place.

    If the template is already set up for different first page, then you need to (as a part of your macro) insert a manual page break (Ctrl-Enter) before going into the Header/Footer view. Then when you exit that view, backspace to delete the page break.

    If you are looking for VB code rather than VBA, you are talking (writing?) to the wrong guy.

    For more, you might want to also look at:
    <A target="_blank" HREF=http://www.addbalance.com/word/headersfooters.htm>How can I have different headers / footers on different pages?</A> (www.addbalance.com/word/headersfooters.htm).
    Charles Kyle Kenyon
    Madison, Wisconsin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •