Share via


SaveEvent.FileName property

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

Namespace:  Microsoft.Office.Interop.InfoPath
Assembly:  Microsoft.Office.Interop.InfoPath (in Microsoft.Office.Interop.InfoPath.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.

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 namespace