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 DumpArrayToParagraphs(strDoc As String, strArp() As String)
' Procedure :   DumpArrayToParagraphs
' Description:  Dump paragraphs from the array to the named document.
' By:           Chris Greaves Inc.
' Inputs:       String document name, string array.
' Returns:      None
' Assumes:      None.
' Side Effects: The document selection point will be reloaded.
' Tested:      By the calls shown below.
    Dim lngP As Long
    Dim strOld As String
    For lngP = 0 To UBound(strArp)
        Call strStatusBar("Writing " & Format(100 * (lngP / UBound(strArp)), "###.000") & "%")
        If strOld = strArp(lngP) Then
        Else
            Selection.TypeText (strArp(lngP))
            strOld = strArp(lngP)
        End If
    Next lngP
    While (Documents(strDoc).Paragraphs.Count > 1) And (Len(ActiveDocument.Paragraphs(1).Range.Text) < 2)
        ActiveDocument.Paragraphs(1).Range.Delete
    Wend
    While (Documents(strDoc).Paragraphs.Count > 1) And (Len(ActiveDocument.Paragraphs.Last.Range.Text) < 2)
        ActiveDocument.Paragraphs.Last.Range.Delete
    Wend
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 DumpArrayToParagraphs(strDoc As String, strArp() As String)
' Procedure :   DumpArrayToParagraphs
' Description:  Dump paragraphs from the array to the named document.
' By:           Chris Greaves Inc.
' Inputs:       String document name, string array.
' Returns:      None
' Assumes:      None.
' Side Effects: The document selection point will be reloaded.
' Tested:      By the calls shown below.
    Dim lngP As Long
    Dim strOld As String
    For lngP = 0 To UBound(strArp)
        Call strStatusBar("Writing " & Format(100 * (lngP / UBound(strArp)), "###.000") & "%")
        If strOld = strArp(lngP) Then
        Else
            Selection.TypeText (strArp(lngP))
            strOld = strArp(lngP)
        End If
    Next lngP
    While (Documents(strDoc).Paragraphs.Count > 1) And (Len(ActiveDocument.Paragraphs(1).Range.Text) < 2)
        ActiveDocument.Paragraphs(1).Range.Delete
    Wend
    While (Documents(strDoc).Paragraphs.Count > 1) And (Len(ActiveDocument.Paragraphs.Last.Range.Text) < 2)
        ActiveDocument.Paragraphs.Last.Range.Delete
    Wend
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