Upravit

Sdílet prostřednictvím


XmlFormCollection.New Method

Definition

Overloads

New(String)

Creates a new form that is based on the specified form.

New(String, XmlFormOpenMode)

Creates a new form that is based on the specified form by using the specified open mode behavior.

New(String)

Creates a new form that is based on the specified form.

public:
 abstract Microsoft::Office::InfoPath::XmlForm ^ New(System::String ^ formLocation);
public abstract Microsoft.Office.InfoPath.XmlForm New (string formLocation);
abstract member New : string -> Microsoft.Office.InfoPath.XmlForm
Public MustOverride Function New (formLocation As String) As XmlForm

Parameters

formLocation
String

The Uniform Resource Identifier (URI) of the form on which to base the new form.

Returns

An XmlForm object that represents the new form that was created.

Exceptions

The New method was called from an event handler for the Loading event.

Examples

In the following code example, the New method of the XmlFormCollection class is passed the URI of an existing form on which to base the new form and the new form's associated XmlForm object is returned.

XmlForm newDocument = 
   this.Application.XmlForms.New(@"C:\MyForm.xml");
Dim newDocument As XmlForm  = _
   Me.Application.XmlForms.New("C:\MyForm.xml")

Remarks

The New method can only be used to create a new form that is based on an existing form; it cannot be used to create a new form that is based on a form template. To create a form from a form template, use the NewFromFormTemplate method.

When you use the New method, the new 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

New(String, XmlFormOpenMode)

Creates a new form that is based on the specified form by using the specified open mode behavior.

public:
 abstract Microsoft::Office::InfoPath::XmlForm ^ New(System::String ^ formLocation, Microsoft::Office::InfoPath::XmlFormOpenMode behavior);
public abstract Microsoft.Office.InfoPath.XmlForm New (string formLocation, Microsoft.Office.InfoPath.XmlFormOpenMode behavior);
abstract member New : string * Microsoft.Office.InfoPath.XmlFormOpenMode -> Microsoft.Office.InfoPath.XmlForm
Public MustOverride Function New (formLocation As String, behavior As XmlFormOpenMode) As XmlForm

Parameters

formLocation
String

The Uniform Resource Identifier (URI) of the form on which to base the new form.

behavior
XmlFormOpenMode

An XmlFormOpenMode enumeration that specifies how the form will be opened.

Returns

An XmlForm object that represents the new form that was created.

Exceptions

The New method was called from an event handler for the Loading event.

Examples

In the following code example, the New method of the XmlFormCollection class is passed the URI of an existing form on which to base the new form by using the default open mode, and the new form's associated XmlForm object is returned.

XmlForm newDocument = 
   this.Application.XmlForms.New(@"C:\MyForm.xml", 
   XmlFormOpenMode.Default);
Dim newDocument As XmlForm  = _
   Me.Application.XmlForms.New("C:\MyForm.xml", 
   XmlFormOpenMode.Default)

Remarks

The New method can only be used to create a new form that is based on an existing form; it cannot be used to create a new form that is based on a form template. To create a form from a form template, use the NewFromFormTemplate method.

When you use the New method, the new 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