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
'Usage

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.

Example

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