Share via


VersionUpgradeEvent.DocumentVersion property

Gets the version number of a Microsoft InfoPath form.

Namespace:  Microsoft.Office.Interop.InfoPath.SemiTrust
Assembly:  Microsoft.Office.Interop.InfoPath.SemiTrust (in Microsoft.Office.Interop.InfoPath.SemiTrust.dll)

Syntax

'Declaration
ReadOnly Property DocumentVersion As String
    Get
'Usage
Dim instance As VersionUpgradeEvent
Dim value As String

value = instance.DocumentVersion
string DocumentVersion { get; }

Property value

Type: System.String

Remarks

This property can be used only during the OnVersionUpgrade event.

Important

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.

Examples

In the following example, the DocumentVersion property of the VersionUpgradeEventObject object is used to display the version number of an InfoPath form in a message box:

[InfoPathEventHandler(EventType=InfoPathEventType.OnVersionUpgrade)]
public void OnVersionUpgrade(VersionUpgradeEvent e)
{
 thisXDocument.UI.Alert("The form version: " + e.DocumentVersion + 
  "\nThe form template version: " + e.SolutionVersion);
 e.ReturnStatus = true;   
}

See also

Reference

VersionUpgradeEvent interface

VersionUpgradeEvent members

Microsoft.Office.Interop.InfoPath.SemiTrust namespace