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 LoadParagraphsToArray(strDoc As String, strArp() As String)
' Procedure:    LoadParagraphsToArray
' Description:  Load all non-empty, non duplicate paragraphs from the named document to the array.
' By:           Chris Greaves Inc.
' Inputs:       String document name, string array.
' Returns:      None
' Assumes:      None.
' Side Effects: The array will be emptied and reloaded.
' Tested:      By the calls shown below.
    ReDim strArp(0)
    Dim strP As Paragraph
    Dim strOld As String
    For Each strP In ActiveDocument.Paragraphs
        Call strStatusBar("Loading " & Format(100 * (strP.Range.Start / ActiveDocument.Characters.Count), "###.000") & "%")
        If Len(strP.Range.Text) < 2 Then
        Else
            If strOld = strP.Range.Text Then
            Else
                strOld = strP.Range.Text
                strArp(UBound(strArp)) = strP.Range.Text
                ReDim Preserve strArp(UBound(strArp) + 1)
            End If
        End If
    Next strP
    ReDim Preserve strArp(UBound(strArp) - 1)
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 LoadParagraphsToArray(strDoc As String, strArp() As String)
' Procedure:    LoadParagraphsToArray
' Description:  Load all non-empty, non duplicate paragraphs from the named document to the array.
' By:           Chris Greaves Inc.
' Inputs:       String document name, string array.
' Returns:      None
' Assumes:      None.
' Side Effects: The array will be emptied and reloaded.
' Tested:      By the calls shown below.
    ReDim strArp(0)
    Dim strP As Paragraph
    Dim strOld As String
    For Each strP In ActiveDocument.Paragraphs
        Call strStatusBar("Loading " & Format(100 * (strP.Range.Start / ActiveDocument.Characters.Count), "###.000") & "%")
        If Len(strP.Range.Text) < 2 Then
        Else
            If strOld = strP.Range.Text Then
            Else
                strOld = strP.Range.Text
                strArp(UBound(strArp)) = strP.Range.Text
                ReDim Preserve strArp(UBound(strArp) + 1)
            End If
        End If
    Next strP
    ReDim Preserve strArp(UBound(strArp) - 1)
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