SetFileName
Collapse the table of content
Expand the table of content

IAttachmentExecute::SetFileName method

Specifies and stores the proposed name of the file.

Syntax


HRESULT SetFileName(
  [in] LPCWSTR pszFileName
);

Parameters

pszFileName [in]

Type: LPCWSTR

A pointer to a string that contains the file name.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code, including the following.

Return codeDescription
E_INVALIDARG

The pszFileName value is is set to NULL, points to an empty string, or points to a file name longer than MAX_PATH.

E_UNEXPECTED

The file name cannot be stored.

 

Remarks

No path information should be included at pszFileName, just the file's name.

IAttachmentExecute::SetFileName can be used by the calling application to check the validity of the file name before copying the file locally. The file name is checked for name collisions against other files stored at the local path location.

IAttachmentExecute::SetFileName is optional.

Requirements

Minimum supported client

Windows XP with SP2 [desktop apps only]

Minimum supported server

Windows Server 2003 [desktop apps only]

Header

Shobjidl.h

IDL

Shobjidl.idl

DLL

Shdocvw.dll (version 6.0 or later)

See also

IAttachmentExecute
IAttachmentExecute::SetLocalPath

 

 

Show:
© 2016 Microsoft