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 CleanHeadNames(Optional strFollow As String = "", Optional intTail As Integer = 0)
' Procedure :   CleanHeadNames
' Description:  Reset the heading styles to a user default.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING generic name of following paragraph style,
' Returns:      A variant array of strings.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
    ' Original coding by Andrew Lockton
    ' Optional help by Geoff Whitfield
    Dim n As Integer
    For n = 1 To 9 ' Loop through the built-in types.
        With ActiveDocument.Styles("Heading " & n)
            .NameLocal = "Heading " & n
            .AutomaticallyUpdate = False
            If n = 1 Then
                .BaseStyle = "Normal"
            Else:
                .BaseStyle = "Heading " & (n - 1)
            End If
            If strFollow = "" Then
                .NextParagraphStyle = "Normal"
            Else
                .NextParagraphStyle = strFollow & String(intTail, Trim(n))
            End If
        End With
    Next n
' Sub cmd_CleanHeadNames()
'Call CleanHeadNames("Text", 1) ' Each heading style followed by a corresponding numbered Text style.
'Call CleanHeadNames("", 1) ' Each heading style followed by the Normal style.
'Call CleanHeadNames("Text", 0) ' Each heading style followed by one common Text style.
'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 CleanHeadNames(Optional strFollow As String = "", Optional intTail As Integer = 0)
' Procedure :   CleanHeadNames
' Description:  Reset the heading styles to a user default.
' Copyright:    Chris Greaves Inc.
' Inputs:       STRING generic name of following paragraph style,
' Returns:      A variant array of strings.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       By the calls shown below.
    ' Original coding by Andrew Lockton
    ' Optional help by Geoff Whitfield
    Dim n As Integer
    For n = 1 To 9 ' Loop through the built-in types.
        With ActiveDocument.Styles("Heading " & n)
            .NameLocal = "Heading " & n
            .AutomaticallyUpdate = False
            If n = 1 Then
                .BaseStyle = "Normal"
            Else:
                .BaseStyle = "Heading " & (n - 1)
            End If
            If strFollow = "" Then
                .NextParagraphStyle = "Normal"
            Else
                .NextParagraphStyle = strFollow & String(intTail, Trim(n))
            End If
        End With
    Next n
' Sub cmd_CleanHeadNames()
'Call CleanHeadNames("Text", 1) ' Each heading style followed by a corresponding numbered Text style.
'Call CleanHeadNames("", 1) ' Each heading style followed by the Normal style.
'Call CleanHeadNames("Text", 0) ' Each heading style followed by one common Text style.
'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