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 strModifyHeaderFooterThisPage(strText As String, lngHeaderType As Long) As String
' Procedure :   strModifyHeaderFooterThisPage
' Description:  Change the header/footer text for the current page
' Copyright: Chris Greaves Inc.
' Inputs:       New text for the current page, Header/Footer type
' Returns:      Original text of the header/footer
' Assumes:      Nothing
' Side Effects: None
' Tested:       By the calls shown below.
    ' First let's preserve the existing text
    Dim strOriginal As String
    strOriginal = strGetHeaderFooterText(lngHeaderType)
    ' Now let's load it into the following page
    Call boolDisconnectHeaderFooter(wdSeekCurrentPageFooter, False)
    Selection.TypeText (strOriginal)
    ' Now let's load the next text into the previous page
    Selection.GoTo what:=wdGoToPage, Which:=wdGoToAbsolute, Name:=Selection.Information(wdActiveEndPageNumber) - 1
'    Call strGetHeaderFooterText(lngHeaderType, strText)
    ' And return the original text as our result
    strModifyHeaderFooterThisPage = strOriginal
'Sub TESTstrModifyHeaderFooterThisPage()
'MsgBox strModifyHeaderFooterThisPage("here is the new text", wdSeekCurrentPageFooter)
'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

 

 

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 strModifyHeaderFooterThisPage(strText As String, lngHeaderType As Long) As String
' Procedure :   strModifyHeaderFooterThisPage
' Description:  Change the header/footer text for the current page
' Copyright: Chris Greaves Inc.
' Inputs:       New text for the current page, Header/Footer type
' Returns:      Original text of the header/footer
' Assumes:      Nothing
' Side Effects: None
' Tested:       By the calls shown below.
    ' First let's preserve the existing text
    Dim strOriginal As String
    strOriginal = strGetHeaderFooterText(lngHeaderType)
    ' Now let's load it into the following page
    Call boolDisconnectHeaderFooter(wdSeekCurrentPageFooter, False)
    Selection.TypeText (strOriginal)
    ' Now let's load the next text into the previous page
    Selection.GoTo what:=wdGoToPage, Which:=wdGoToAbsolute, Name:=Selection.Information(wdActiveEndPageNumber) - 1
'    Call strGetHeaderFooterText(lngHeaderType, strText)
    ' And return the original text as our result
    strModifyHeaderFooterThisPage = strOriginal
'Sub TESTstrModifyHeaderFooterThisPage()
'MsgBox strModifyHeaderFooterThisPage("here is the new text", wdSeekCurrentPageFooter)
'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

 

 

Hosted by www.Geocities.ws

1