Edit

Share via


Subdocuments.AddFromFile Method

Definition

Adds the specified subdocument to the master document at the start of the selection and returns a Subdocument object.

public Microsoft.Office.Interop.Word.Subdocument AddFromFile (ref object Name, ref object ConfirmConversions, ref object ReadOnly, ref object PasswordDocument, ref object PasswordTemplate, ref object Revert, ref object WritePasswordDocument, ref object WritePasswordTemplate);
abstract member AddFromFile : obj * obj * obj * obj * obj * obj * obj * obj -> Microsoft.Office.Interop.Word.Subdocument
Public Function AddFromFile (ByRef Name As Object, Optional ByRef ConfirmConversions As Object, Optional ByRef ReadOnly As Object, Optional ByRef PasswordDocument As Object, Optional ByRef PasswordTemplate As Object, Optional ByRef Revert As Object, Optional ByRef WritePasswordDocument As Object, Optional ByRef WritePasswordTemplate As Object) As Subdocument

Parameters

Name
Object

Required Object. The file name of the subdocument to be inserted into the master document.

ConfirmConversions
Object

Optional Object. True to confirm file conversion in the Convert File dialog box if the file isn't in Microsoft Word format.

ReadOnly
Object

Optional Object. True to insert the subdocument as a read-only document.

PasswordDocument
Object

Optional Object. The password required to open the subdocument if it's password protected.

PasswordTemplate
Object

Optional Object. The password required to open the template attached to the subdocument if the template is password protected.

Revert
Object

Optional Object. Controls what happens if Name is the file name of an open document. True to insert the saved version of the subdocument. False to insert the open version of the subdocument, which may contain unsaved changes.

WritePasswordDocument
Object

Optional Object. The password required to save changes to the document file if it's write protected.

WritePasswordTemplate
Object

Optional Object. The password required to save changes to the template attached to the subdocument if the template is write protected.

Returns

Remarks

Note If the active view isn't either outline view or master document view, an error occurs.

Applies to