Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.



Public Function boolSplitFromPreviousPage(lngPageNumber As Long, lngSectionNumber As Long, lngHeaderFooterType As Long) As Boolean
    ' 2) split from previous page
    If lngPageNumber <> 1 Then
        Call lngGoToPage(intcBottomOfPage, lngPageNumber - 1)
        If lngSectionNumber = lngGetCurrentSectionNumber Then ' it is the same section; break it.
            Selection.MoveRight Unit:=wdCharacter, Count:=1 ' scoot to top of next page
            Call lngInsertBreak(wdSectionBreakContinuous) ' insert a section break (continuous)
            ActiveWindow.ActivePane.View.Type = wdPageView
            ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
            Selection.HeaderFooter.LinkToPrevious = False ' break the links.
            Call boolCloseHeaderFooter
        Else ' it is a different section. return to our home page.
            Selection.MoveRight Unit:=wdCharacter, Count:=1 ' scoot to top of next page
        End If
    Else
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1

Visual Basic (VB and VBA)

Copyright 1999-2001 Christopher Greaves. All rights reserved.
Home Page and email to [email protected]
If in doubt, record a macro and inspect the entrails!

 

 

Please read the DISCLAIMER.

Here is an INDEX to all the procedures.

You will probably need one copy of my GLOBAL DECLARATIONS.

Public Function boolSplitFromPreviousPage(lngPageNumber As Long, lngSectionNumber As Long, lngHeaderFooterType As Long) As Boolean
    ' 2) split from previous page
    If lngPageNumber <> 1 Then
        Call lngGoToPage(intcBottomOfPage, lngPageNumber - 1)
        If lngSectionNumber = lngGetCurrentSectionNumber Then ' it is the same section; break it.
            Selection.MoveRight Unit:=wdCharacter, Count:=1 ' scoot to top of next page
            Call lngInsertBreak(wdSectionBreakContinuous) ' insert a section break (continuous)
            ActiveWindow.ActivePane.View.Type = wdPageView
            ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
            Selection.HeaderFooter.LinkToPrevious = False ' break the links.
            Call boolCloseHeaderFooter
        Else ' it is a different section. return to our home page.
            Selection.MoveRight Unit:=wdCharacter, Count:=1 ' scoot to top of next page
        End If
    Else
    End If
End Function

We all knew nothing when we started …
Home Page and Contact Information
Send email to [email protected].
This page was last updated Thursday, November 15, 2001

 

 

Hosted by www.Geocities.ws

1