InsertFile Method Example

This example uses an INCLUDETEXT field to insert the TEST.DOC file at the insertion point.

Selection.Collapse Direction:=wdCollapseEnd
Selection.InsertFile FileName:="C:\TEST.DOC", Link:=True

This example creates a new document and then inserts the contents of each text file in the C:\TMP folder into the new document.

Documents.Add
ChDir "C:\TMP"
myName = Dir("*.TXT")
While myName <> ""
    With Selection
        .InsertFile FileName:=myName, ConfirmConversions:=False
        .InsertParagraphAfter
        .InsertBreak Type:=wdSectionBreakNextPage
        .Collapse Direction:=wdCollapseEnd
    End With
    myName = Dir()
Wend