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