Adding a New Document and Inserting Contents of an Array:   Return to List

Documents.Add Template:="", NewTemplate:=False
For i = 0 To UBound(myTempArray())
     Selection.TypeText myTempArray(i) & Chr(13)
Next
Selection.HomeKey Unit:=wdStory

' To eliminate duplicates at the same time (assuming array is sorted)

OldTerm = ""
InsertCount = 0
Documents.Add Template:="", NewTemplate:=False
For i = 0 To UBound(myTempArray(), 2)
    NewTerm = myTempArray(1, i)
    If NewTerm <> OldTerm Then
        Selection.TypeText NewTerm & Chr(13)
        OldTerm = NewTerm
        InsertCount = InsertCount + 1
    End If
Next
Selection.HomeKey Unit:=wdStory

See also:
Array Converted to Delimited Text String
Building an Array of Filenames (after browse)
Delimited Text to an Array (similar to Split())
Determining Upper & Lower Array Bounds
Erasing an Array (removing all the elements)
Filename Array from Active Directory
QuickSort routine
QuickSort Single Dimension
QuickSort (Fast!!) (Multidimensional on 2 dims)
QuickSort (Fast!!) (Multidimensional on 3 dims)
Removing Duplicates from an Array
SQL Query Results placed in an Array
Using Split() function to create Array



Note to Webmaster