Results 1 to 2 of 2
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Location
    Brisbane, Queensland, Australia
    Posts
    18
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Word 97 VBA LinkToPrevious problem (English Word 97)

    Using Access 97 automation, I am trying to create a word 97 document which has a different header/foot for each section.
    Every time I use the LinkToPrevious=False, the automation loses the cursor focus and either ends up in the previous section or (it seems) ramdomly elsewhere.

    If I record the action in a word macro and run it, the same also happens.

    Any ideas of what I can do?

  2. #2
    Super Moderator
    Join Date
    Dec 2000
    Location
    New York, NY
    Posts
    2,970
    Thanks
    3
    Thanked 29 Times in 27 Posts

    Re: Word 97 VBA LinkToPrevious problem (English Word 97)

    Hard to know exactly what is happening without seeing the code.
    Are you 'physically' putting the cursor into each header and footer? - it may work more reliably if you avoid doing that:

    <pre>Public Sub RemoveSectionsLinkToPrevious()

    Dim Sect As Section
    Dim HdrFtr As HeaderFooter
    For Each Sect In ActiveDocument.Sections
    For Each HdrFtr In sect.Headers
    HdrFtr.LinkToPrevious = False
    Next
    For Each HdrFtr In sect.Footers
    HdrFtr.LinkToPrevious = False
    Next
    Next

    End Sub</pre>

    Gary

Posting Permissions

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