Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    VBA error message (2003)

    I am using the following code in a Word Template

    With ActiveWindow
    If .View.SplitSpecial = wdPaneNone Then
    .ActivePane.View.Type = wdPageView
    End If
    .ActivePane.View.SeekView = wdSeekMainDocument
    .View.Type = wdPageView
    End With

    At run time I'm receiving the following message that this is only available in Print Layout view

    This is what I'm trying to accomplish
    1. Go to a bookmark in the footer
    2. Insert some information
    3. Close the footer and return to print layout view.

    Everything works file until it comes time to close the footer.

    For some odd reason when the code runs, the document switches to "normal view". Then I get an error message.
    Thanks

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

    Re: VBA error message (2003)

    Does this work?

    With ActiveWindow
    If .View.SplitSpecial <> wdPaneNone Then
    .Panes(2).Close
    End If
    .View.Type = wdPageView
    .ActivePane.View.SeekView = wdSeekMainDocument
    End With

  3. #3
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: VBA error message (2003)

    Have you considered adding the text by using Range objects rather than actually selecting the footer and changing the views? This is often much quicker and more reliable.

    Something as simple as
    <code> ActiveDocument.Bookmarks("textinfooter").Range.Ins ertAfter "Added Text"</code>
    may do what you need.

    StuartR

  4. #4
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA error message (2003)

    Actually I am using this line to insert the text in the footer at the bookmark, but the footer does not automatically close.

  5. #5
    2 Star Lounger
    Join Date
    Mar 2004
    Location
    Portland, Oregon
    Posts
    173
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: VBA error message (2003)

    YES! That worked wonderfully! Thank you!

Posting Permissions

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