Results 1 to 9 of 9
  1. #1
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Bookmark in header (2000)-MULTI-Bookmark in header (2000)

    When I use an ASK field for user information, then use a REF field to reproduce the information, it works OK in the document body, but not in a header.

    Any suggestions please.

    Alan

  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 (2000)-MULTI-Bookmark in header (2000)

    Hi Alan:

    Have you tried updating the fields? I'm not sure what you're trying to do, but whether your ask field is in the header or body & whether the ref field is in the header or body, the ref field should contain the result of the bookmark.

    If you want to update the fields in the header, you either need to print, print preview, repaginate the document (by switching from normal view to print layout, for example) or opening the header, selecting the fields & pressing F9.

    Hope this helps.

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmark in header (2000)-MULTI-Bookmark in header%2

    Thanks Phil. I can see that your suggestions do work. What I am trying to do is have the user create a new doc by first filling out some ASK fields. When finished, they should see the new doc "shell" ready for them to add to.

    Obviously, I need to use one of the methods you suggest for their view to be updated properly, to avoid confusion for them. Maybe use an autoexec macro to do the whole thing? Or maybe a "default" for the REF, saying "This will print OK" or similar? Do you have any thoughts here?

    Appreciate your reply

    Alan

  4. #4
    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 (2000)-MULTI-Bookmark in header%2

    Hi Alan:

    I haven't worked extensively with ASK fields, but I have found that the REF fields that hold their results are not updated automatically, unfortunately. I've also found that if you use an AutoNew or AutoOpen macro to prompt the ASK field that some REF fields will update, some won't.

    For example, suppose you have text {REF bk1} more text {ASK bk1 prompt} more text {REF bk1}. When you open the document, you are prompted for the ask field. When you enter text, the second REF field is updated, but not the first. If you close & save the document, reopening it gives you a prompt, of course. The first REF field is updated to the value of the ASK field at the time it was opened. i.e. if you change what you type each time you are prompted, the first REF field is always 1 step behind the second REF field.

    This means that you have to be careful about how you set up your document. If you start moving ASK or REF fields, you could get inconsistent results.

    One piece of code that you could use in a AutoNew or AutoOpen macro would be:

    ActiveDocument.Fields.Update 'this gets the fields to ask
    ActiveDocument.PrintPreview 'this gets the REF fields updated that use the bookmarks set by the ASK.

    Microsoft itself recommends two macros for this purpose:
    To run the macro when you open the document, type the following code:

    Sub AutoOpen()
    Dim aStory As Range
    Dim aField As Field
    For Each aStory In ActiveDocument.StoryRanges
    For Each aField In aStory.Fields
    aField.Update
    Next aField
    Next aStory
    End Sub

    Sub AutoNew()
    Dim aStory As Range
    Dim aField As Field
    For Each aStory In ActiveDocument.StoryRanges
    For Each aField In aStory.Fields
    aField.Update
    Next aField
    Next aStory
    End Sub

    You can see <A target="_blank" HREF=http://support.microsoft.com/support/kb/articles/Q212/7/03.ASP>How to Automatically Update Fields</A> for their solution.

    Hope this helps.

  5. #5
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmark in header (2000)-MULTI-Bookmark in header%2

    Many thanks Phil. This use of fields does, indeed, seem to be buggy & not without its problems. I shall endeavour to understand & use the code you kindly supplied. I think I get the general idea <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Will also check the link out. This should keep me quiet, at least for a while.

    Thank you

    Alan

  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 (2000)-MULTI-Bookmark in header (2000)

    You may want to take a look at the ASK field tutorial that you can download from <A target="_blank" HREF=http://addbalance.com/word/download/index.htm#AskField> my downloads page - Ask Field Tutorial</A>.
    Charles Kyle Kenyon
    Madison, Wisconsin

  7. #7
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmark in header (2000)-MULTI-Bookmark in header%2

    Thanks Chas. I ventured to your site before posting my query. I found it very helpful generally, with lots of info I had no idea of. Unfirtunately I was unable find answers to my fields in headers problems. But I have your site prominently bookmarked <img src=/S/smile.gif border=0 alt=smile width=15 height=15>

    Alan

  8. #8
    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 (2000)-MULTI-Bookmark in header%2

    The AutoOpen macro in the sample document and the AutoNew macro in the sample template both update REF fields in the headers and footers. These don't update ASK fields in the headers or footers since I don't put ASK fields there. They do update the ASK fields in the body of the document/template.

    I'll be adding text in the near future (when I do version 9.6) to point that out.
    Charles Kyle Kenyon
    Madison, Wisconsin

  9. #9
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Bookmark in header (2000)-MULTI-Bookmark in header%2

    Perhaps I could get a bit more specific at this point. I use several ASK fields in the body of the doc. These carry REF fields in both the body and the header. That is, I want to reproduce the information at one place in the body, but also have it appear in the header.

    I have found the body update to be no problem. The header update I have solved by creating the new doc from the template without headers visible, run through all the ASK fields, then switch to a view which shows the headers. This seems to work, but I was looking for a "nicer" option if available.

    I will continue with this quest, since I'm learning a lot along the way. Thanks for all the help & look forward to your new tutorials.

    Alan

Posting Permissions

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