Selection.InsertFile Method
Inserts all or part of the specified file.
Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in Microsoft.Office.Interop.Word.dll)
Syntax
'Declaration
Sub InsertFile ( _
FileName As String, _
ByRef Range As Object, _
ByRef ConfirmConversions As Object, _
ByRef Link As Object, _
ByRef Attachment As Object _
)
'Usage
Dim instance As Selection
Dim FileName As String
Dim Range As Object
Dim ConfirmConversions As Object
Dim Link As Object
Dim Attachment As Object
instance.InsertFile(FileName, Range, ConfirmConversions, _
Link, Attachment)
void InsertFile(
string FileName,
ref Object Range,
ref Object ConfirmConversions,
ref Object Link,
ref Object Attachment
)
Parameters
- FileName
Type: System.String
Required String. The path and file name of the file to be inserted. If you don't specify a path, Microsoft Word assumes the file is in the current folder.
- Range
Type: System.Object%
Optional Object. If the specified file is a Word document, this parameter refers to a bookmark. If the file is another type (for example, a Microsoft Excel worksheet), this parameter refers to a named range or a cell range (for example, R1C1:R3C4).
- ConfirmConversions
Type: System.Object%
Optional Object. True to have Word prompt you to confirm conversion when inserting files in formats other than the Word Document format.
- Link
Type: System.Object%
Optional Object. True to insert the file by using an INCLUDETEXT field.
- Attachment
Type: System.Object%
Optional Object. True to insert the file as an attachment to an e-mail message.