Range.ImportFragment (Word)

Imports a document fragment into the document at the specified range.

This method replaces the contents of a range. To stop this from occurring, use the Collapse method before using this method.

ImportFragment (FileName, MatchDestination)


Dim strFileName As String: strFileName =  
ActiveDocument.Range.ImportFragment FileName:=strFileName

Arguments

The following argument is required

FileName (String) - Specifies the path and file name where the document fragment is stored.

Optional arguments

The following argument is optional

MatchDestination (Boolean) - Specifies whether to match the destination formatting. If False, the imported document fragment retains the formatting in the original document. Default value is False.