Results 1 to 2 of 2
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hidden section break causing loop in word (word97 sr2b)

    Hiya - we have a word document with 5 section breaks.
    we have code that updates footers - therefore it goes to the next footer.

    However when a doc doesnt have a next sequentional header/footer due to a continous section break inserted instead of being ie section 3, section 4, section 5
    so when a continous section break is inserted the headers/footers are displayed as section 3, section 5
    the code goes into a loop because it cant find section 4.

    normally i find the continous section break & amend by placing a page break & it works.
    However for this doc I cant find section 4 section break.

    I've searched all the breaks -searched for hidden text - viewed in normal view
    Is there anyway I track down this section break for section 4.
    do you need more info?
    TIA Diana

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: hidden section break causing loop in word (word97 sr2b)

    Can you use ranges instead of selection objects? Appended below is an example that should give you enough guidance.
    <pre>Public Function HeaderTableChange(bPortrait As Boolean, iSect As Integer)
    'called by PageSetupFlip sub
    Dim aTable As Table
    With ActiveDocument.Sections(iSect)
    For Each aTable In .Headers(wdHeaderFooterPrimary).Range.Tables
    If aTable.Columns.count = 3 Then
    aTable.Columns(1).Width = CentimetersToPoints(3)
    aTable.Columns(3).Width = CentimetersToPoints(3)
    If bPortrait Then
    aTable.Columns(2).Width = CentimetersToPoints(10)
    Else
    aTable.Columns(2).Width = CentimetersToPoints(19.7)
    End If
    End If 'Columns.Count EndIf
    Next aTable 'Loop for any other tables in header
    End With 'Sections(iSect) End With
    End Function</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

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