XmlFormCollection.Open Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Open(String) |
Opens the specified form. |
Open(String, XmlFormOpenMode) |
Opens the specified form by using the specified open mode behavior. |
Open(String)
Opens the specified form.
public:
abstract Microsoft::Office::InfoPath::XmlForm ^ Open(System::String ^ fileLocation);
public abstract Microsoft.Office.InfoPath.XmlForm Open (string fileLocation);
abstract member Open : string -> Microsoft.Office.InfoPath.XmlForm
Public MustOverride Function Open (fileLocation As String) As XmlForm
Parameters
- fileLocation
- String
The Uniform Resource Identifier (URI) of the form to open.
Returns
An XmlForm object that represents the form that was opened.
Examples
In the following code example, the Open method of the XmlFormCollection class is passed the URI of the form to open, and its associated XmlForm object is returned.
XmlForm document = this.Application.XmlForms.Open(@"C:\MyForm.xml");
Dim document As XmlForm = Me.Application.XmlForms.Open("C:\MyForm.xml")
Remarks
The Open method can only be used to open a form; it cannot be used to open a form template. To create a form from a form template, use the NewFromFormTemplate method. To create a form that is based on an existing form, use the New(String, XmlFormOpenMode) method.
When you use the Open method, the specified form opens in Microsoft InfoPath and is ready to be filled out.
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.
Applies to
Open(String, XmlFormOpenMode)
Opens the specified form by using the specified open mode behavior.
public:
abstract Microsoft::Office::InfoPath::XmlForm ^ Open(System::String ^ fileLocation, Microsoft::Office::InfoPath::XmlFormOpenMode behavior);
public abstract Microsoft.Office.InfoPath.XmlForm Open (string fileLocation, Microsoft.Office.InfoPath.XmlFormOpenMode behavior);
abstract member Open : string * Microsoft.Office.InfoPath.XmlFormOpenMode -> Microsoft.Office.InfoPath.XmlForm
Public MustOverride Function Open (fileLocation As String, behavior As XmlFormOpenMode) As XmlForm
Parameters
- fileLocation
- String
The Uniform Resource Identifier (URI) of the form to open.
- behavior
- XmlFormOpenMode
An XmlFormOpenMode enumeration that specifies how the form will be opened.
Returns
An XmlForm object that represents the form that was opened.
Examples
In the following code example, the Open method of the XmlFormCollection class is passed the URI of the form to open in read-only mode and its associated XmlForm object is returned.
XmlForm document = this.Application.XmlForms.Open(
@"C:\MyForm.xml", XmlFormOpenMode.ReadOnly);
Dim document As XmlForm = Me.Application.XmlForms.Open(_
"C:\MyForm.xml", XmlFormOpenMode.ReadOnly)
Remarks
The Open method can only be used to open a form; it cannot be used to open a form template. To create a form from a form template, use the NewFromFormTemplate method. To create a form that is based on an existing form, use the New(String, XmlFormOpenMode) method.
When you use the Open method, the specified form opens in Microsoft InfoPath and is ready to be filled out.
This member can be accessed only by forms running in the same domain as the currently open form, or by forms that have been granted cross-domain permissions.
This type or member can be accessed only from code running in forms opened in Microsoft InfoPath Filler.