Subdocuments.AddFromFile Method 

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

Namespace: Microsoft.Office.Interop.Word
Assembly: Microsoft.Office.Interop.Word (in microsoft.office.interop.word.dll)

Usage

Dim Name As Object
Dim ConfirmConversions As Object
Dim ReadOnly As Object
Dim PasswordDocument As Object
Dim PasswordTemplate As Object
Dim Revert As Object
Dim WritePasswordDocument As Object
Dim WritePasswordTemplate As Object
Dim returnValue As Subdocument
Dim subdocuments1 As Subdocuments
returnValue = subdocuments1.AddFromFile(Name, ConfirmConversions, ReadOnly, PasswordDocument, PasswordTemplate, Revert, WritePasswordDocument, WritePasswordTemplate)

Syntax

Function AddFromFile( _
    <InAttribute()> ByRef Name As Object, _
    <InAttribute()> Optional ByRef ConfirmConversions As Object, _
    <InAttribute()> Optional ByRef ReadOnly As Object, _
    <InAttribute()> Optional ByRef PasswordDocument As Object, _
    <InAttribute()> Optional ByRef PasswordTemplate As Object, _
    <InAttribute()> Optional ByRef Revert As Object, _
    <InAttribute()> Optional ByRef WritePasswordDocument As Object, _
    <InAttribute()> Optional ByRef WritePasswordTemplate As Object _
) As Subdocument
Subdocument AddFromFile(
    [In] ref object Name, 
    [In, Optional] ref object ConfirmConversions, 
    [In, Optional] ref object ReadOnly, 
    [In, Optional] ref object PasswordDocument, 
    [In, Optional] ref object PasswordTemplate, 
    [In, Optional] ref object Revert, 
    [In, Optional] ref object WritePasswordDocument, 
    [In, Optional] ref object WritePasswordTemplate
);
public: Subdocument^ AddFromFile(
    &Object^ Name, 
    &Object^ ConfirmConversions, 
    &Object^ ReadOnly, 
    &Object^ PasswordDocument, 
    &Object^ PasswordTemplate, 
    &Object^ Revert, 
    &Object^ WritePasswordDocument, 
    &Object^ WritePasswordTemplate
);
public Subdocument AddFromFile(
    /*in*/System.Object Name, 
    /*in*/System.Object ConfirmConversions, 
    /*in*/System.Object ReadOnly, 
    /*in*/System.Object PasswordDocument, 
    /*in*/System.Object PasswordTemplate, 
    /*in*/System.Object Revert, 
    /*in*/System.Object WritePasswordDocument, 
    /*in*/System.Object WritePasswordTemplate
);
function AddFromFile(
     Name : Object, 
     ConfirmConversions : Object, 
     ReadOnly : Object, 
     PasswordDocument : Object, 
     PasswordTemplate : Object, 
     Revert : Object, 
     WritePasswordDocument : Object, 
     WritePasswordTemplate : Object
) : Subdocument;

Parameters

  • Name
    Required Object. The file name of the subdocument to be inserted into the master document.
  • ConfirmConversions
    Optional Object. True to confirm file conversion in the Convert File dialog box if the file isn't in Microsoft Word format.
  • ReadOnly
    Optional Object. True to insert the subdocument as a read-only document.
  • PasswordDocument
    Optional Object. The password required to open the subdocument if it's password protected.
  • PasswordTemplate
    Optional Object. The password required to open the template attached to the subdocument if the template is password protected.
  • Revert
    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
    Optional Object. The password required to save changes to the document file if it's write protected.
  • WritePasswordTemplate
    Optional Object. The password required to save changes to the template attached to the subdocument if the template is write protected.

Remarks

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

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Platforms

Development Platforms

Windows XP Home Edition, Windows XP Professional, Windows Server 2003, and Windows 2000

Target Platforms

See Also

Reference

Subdocuments Interface
Microsoft.Office.Interop.Word Namespace

Other Resources

Subdocuments Members