SaveEvent.FileName Property

Gets the file name to be used in the OnSaveRequest event.

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

Syntax

'Declaration
ReadOnly Property FileName As String
    Get
'Usage
Dim instance As SaveEvent
Dim value As String

value = instance.FileName
string FileName { get; }

Property Value

Type: System.String

Remarks

If the IsSaveAs property of the SaveEvent object is true, and a save operation has not yet occurred, the FileName property returns an empty string. If the IsSaveAs property is true and a save operation has already occurred, the value returned by the FileName property is the file name under which the form was saved. If the SaveEvent object represents a save operation (that is, the IsSaveAs property is false), the FileName property returns the same value as the URI property of the XDocument object.

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 FileName property of the SaveEventObject object is used in a notification to the user before a save operation:

public void OnSaveRequest(SaveEvent e)
{
 thisXDocument.UI.Alert("You are about to save this file: " + e.FileName);
}

See Also

Reference

SaveEvent Interface

SaveEvent Members

Microsoft.Office.Interop.InfoPath.SemiTrust Namespace