SetSaveAsDialogLocation Method

Microsoft Office InfoPath

Sets the initial location at which the Save As dialog starts to browse when it is opened.

expression.SetSaveAsDialogLocation(ByVal strLocationUrl As String)

expression    Required. An expression that returns a reference to the UI object.

strLocationUrl    Required. The location, expressed as a URL, at which the Save As dialog box starts browsing.

Security Level

2: 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.

Remarks

The location specified must be an absolute path and it should not include a file name. InfoPath handles invalid paths, however, and no error message is generated if an invalid path is specified for the strLocationUrl argument. The SetSaveAsDialogLocation method may be used in conjunction with the SetSaveAsDialogFileName method.

Note  This object model member is not supported when the Disable Service Pack features option on the Advanced tab of the Options dialog box in InfoPath is selected or when Microsoft Office 2003 Service Pack 1 or later is not installed. Any form that implements this object model member in its code will generate an error message if it is opened in InfoPath when service pack features are disabled or unavailable.

Example

In the following example, the SetSaveAsDialogLocation method of the UI object is used to set the initial location for the Save As dialog:

XDocument.UI.SetSaveAsDialogLocation("\\\\MyShare\\Forms");