Results 1 to 3 of 3

Thread: Automatically Update Header Content

  1. #1

    Automatically Update Header Content

    Hi Guys,
    haven't needed help in a while. I do today and [SOLVED] Select text and move to a header - how to do that in VBA ( almost has what I need. I apologize if I was not supposed to post as an add-on but as a new request.

    Issue: I have a hard coded date in my Word document. I want to update that date manually but as soon as I do, I want the new date to be added to my document header.

    Thanks ahead ...
    Kind regards,
    Last edited by macropod; 12-19-2022 at 12:41 PM.

  2. #2
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Jul 2008
    Your request really has nothing to do with what was discussed in the other thread, from which I've split your post.

    All you need to do is apply a unique Style name to the range spanned by the date in the document body and use a STYLERREF field referencing that Style in the page header. No VBA code required.
    Paul Edstein
    [Fmr MS MVP - Word]

  3. #3
    VBAX Regular
    Jul 2020
    Sun Prairie
    For an example of using a StyleRef Field to do this, look at my Basic Letterhead Template. Insert a page break and look at the second-page header.
    Type a different date on the first page. It will change in the continuation-page header.

Posting Permissions

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