|
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 boolDisconnectHeaderFooter(lngHeaderType As Long, boolDisconnect As Boolean) As Boolean
' Procedure : boolDisconnectHeaderFooter
' Description: Disconnect the header or footer for the current page.
' Copyright: Chris Greaves Inc.
' Inputs: Header/Footer type, FALSE if to be disconnected
' Returns: Original state of connection
' Assumes: Nothing
' Side Effects: We will be left in the header/footer of the following page.
' Tested: By the calls shown below.
Dim lngSectionNumber As Long
lngSectionNumber = Selection.Sections(1).Index
Dim lngPageNumber As Long
lngPageNumber = Selection.Information(wdActiveEndPageNumber)
Selection.GoTo what:=wdGoToPage, Which:=wdGoToAbsolute, Name:=lngPageNumber + 1
If Selection.Sections(1).Index = lngSectionNumber Then ' we are in the same section
Selection.MoveLeft Count:=1
Selection.InsertBreak Type:=wdSectionBreakContinuous
Selection.MoveRight Count:=1
Else
End If
ActiveWindow.ActivePane.View.Type = wdPageView
ActiveWindow.ActivePane.View.SeekView = lngHeaderType
boolDisconnectHeaderFooter = Selection.HeaderFooter.LinkToPrevious
Selection.HeaderFooter.LinkToPrevious = boolDisconnect
'Sub TESTboolDisconnectHeaderFooter()
'MsgBox boolDisconnectHeaderFooter(wdSeekCurrentPageFooter, False)
'End Sub
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 |