Range.ImportFragment Method

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

Namespace:  Microsoft.Office.Interop.Word
Assembly:  Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)

Syntax

'Declaration
Sub ImportFragment ( _
    FileName As String, _
    MatchDestination As Boolean _
)
'Usage
Dim instance As Range
Dim FileName As String
Dim MatchDestination As Boolean

instance.ImportFragment(FileName, MatchDestination)
void ImportFragment(
    string FileName,
    bool MatchDestination
)

Parameters

  • FileName
    Type: System.String
    Required String Specifies the path and file name where the document fragment is stored.
  • MatchDestination
    Type: System.Boolean
    Optional 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.

Remarks

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

See Also

Reference

Range Interface

Range Members

Microsoft.Office.Interop.Word Namespace