Results 1 to 7 of 7
  1. #1
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to Insert a Header (Word 03)

    Er - you forgot the attachment.

  2. #2
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Macro to Insert a Header (Word 03)

    <P ID="edit" class=small>(Edited by ailios on 05-Jun-07 13:46. )</P>I'm updating a macro that inserts a second page header on letters. The macros are all contained on a startup template shared on the network. The letterhead is in with the workgroup templates also shared on the network. The trouble I'm running into is after the macro runs it's suppose to close the header and return the cursor to the top of the letter. Instead after inserting the header it just stops and doesn't close the header space. Attached is the macros in a text file. I'm such a newb at VB. I'm hoping someone can tell me where I'm going wrong.
    Attached Files Attached Files
    Daisy

  3. #3
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Macro to Insert a Header (Word 03)

    Yup, helps if I remember to do that. I've edited and added the attachment above.
    Daisy

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to Insert a Header (Word 03)

    Near the end of the macro, you have this code:
    <hr> If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
    ActivePane.View.Type = wdOutlineView Then
    ActiveWindow.ActivePane.View.Type = wdPrintView
    End If
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
    Selection.HomeKey Unit:=wdStory

    GoTo NoMore<hr>
    The code switches to print layout view, then the line indicated in bold activates the page header again. Try removing or commenting out the bold line.

  5. #5
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Macro to Insert a Header (Word 03)

    I took it out but it still doesn't close the header at the end of the macro.
    Daisy

  6. #6
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Macro to Insert a Header (Word 03)

    Sorry, should have seen that. Change the line to

    ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument

  7. #7
    4 Star Lounger
    Join Date
    Jan 2001
    Location
    Tacoma, Washington, USA
    Posts
    431
    Thanks
    0
    Thanked 3 Times in 3 Posts

    Re: Macro to Insert a Header (Word 03)

    Perfect!
    Daisy

Posting Permissions

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