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 boolSplitFromNextPage(lngPageNumber As Long, lngSectionNumber As Long, lngHeaderFooterType As Long) As Boolean
    ' 3) split from next page
    If lngPageNumber <> ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then
        Call lngGoToPage(intcTopOfPage, lngPageNumber + 1)
        If lngSectionNumber = lngGetCurrentSectionNumber Then ' it is the same section; break it.
            Call lngInsertBreak(wdSectionBreakContinuous)
        Else ' it is a different section.
        End If
' 991028 I have long maintained that Micro$oft have their head in the sand.
' Single-stepping through this code works; running does not!
        ActiveWindow.ActivePane.View.Type = wdPageView
        ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
        Selection.HeaderFooter.LinkToPrevious = False ' break the links.
        Call boolCloseHeaderFooter
' 991028 duplicating the action seems to give Word97 the hint.
        ActiveWindow.ActivePane.View.Type = wdPageView
        ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
        Selection.HeaderFooter.LinkToPrevious = False ' break the links.
        Call boolCloseHeaderFooter
        Call lngGoToPage(intcBottomOfPage, lngPageNumber)
    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 boolSplitFromNextPage(lngPageNumber As Long, lngSectionNumber As Long, lngHeaderFooterType As Long) As Boolean
    ' 3) split from next page
    If lngPageNumber <> ActiveDocument.BuiltInDocumentProperties(wdPropertyPages) Then
        Call lngGoToPage(intcTopOfPage, lngPageNumber + 1)
        If lngSectionNumber = lngGetCurrentSectionNumber Then ' it is the same section; break it.
            Call lngInsertBreak(wdSectionBreakContinuous)
        Else ' it is a different section.
        End If
' 991028 I have long maintained that Micro$oft have their head in the sand.
' Single-stepping through this code works; running does not!
        ActiveWindow.ActivePane.View.Type = wdPageView
        ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
        Selection.HeaderFooter.LinkToPrevious = False ' break the links.
        Call boolCloseHeaderFooter
' 991028 duplicating the action seems to give Word97 the hint.
        ActiveWindow.ActivePane.View.Type = wdPageView
        ActiveWindow.ActivePane.View.SeekView = lngHeaderFooterType
        Selection.HeaderFooter.LinkToPrevious = False ' break the links.
        Call boolCloseHeaderFooter
        Call lngGoToPage(intcBottomOfPage, lngPageNumber)
    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