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 lngParagraphStylesInDoc(strAr() As String, doc As Document) As Long
' Procedure :   lngParagraphStylesInDoc
' Description:  Determines Paragraph styles actually in use in a document.
' By:           Chris Greaves Inc.
' Inputs:       An array name
'               A document.
' Returns:      LONG number of styles found.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       by the calls shown below.
' This simple version just examines the paragraph style of every paragraph
    Dim prg As Paragraph
    For Each prg In Documents(doc).Paragraphs
        Call LoadUnique(strAr, prg.Style.NameLocal, True)
    Next prg
    lngParagraphStylesInDoc = UBound(strAr)
    ReDim Preserve strAr(UBound(strAr) - 1)
'Sub TESTlngParagraphStylesInDoc()
'Dim strAr() As String
'ReDim strAr(0)
'MsgBox lngParagraphStylesInDoc(strAr, ActiveDocument) + 1
'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 lngParagraphStylesInDoc(strAr() As String, doc As Document) As Long
' Procedure :   lngParagraphStylesInDoc
' Description:  Determines Paragraph styles actually in use in a document.
' By:           Chris Greaves Inc.
' Inputs:       An array name
'               A document.
' Returns:      LONG number of styles found.
' Assumes:      Nothing
' Side Effects: None.
' Tested:       by the calls shown below.
' This simple version just examines the paragraph style of every paragraph
    Dim prg As Paragraph
    For Each prg In Documents(doc).Paragraphs
        Call LoadUnique(strAr, prg.Style.NameLocal, True)
    Next prg
    lngParagraphStylesInDoc = UBound(strAr)
    ReDim Preserve strAr(UBound(strAr) - 1)
'Sub TESTlngParagraphStylesInDoc()
'Dim strAr() As String
'ReDim strAr(0)
'MsgBox lngParagraphStylesInDoc(strAr, ActiveDocument) + 1
'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