IExchExtAttachedFileEvents::OnOpenSzFile

Replaces or enhances the behavior of Microsoft Exchange when opening an attachment from a temporary file.

Quick Info

See IExchExtAttachedFileEvents : IUnknown.

HRESULT OnOpenSzFile(
  LPTSTR lpszFile,   
  ULONG ulFlags      
);
 

Parameters

lpszFile
[in] Pointer to a string containing the name and path of the temporary file being opened.
ulFlags
[in] Bitmask of flags. Set this parameter to one of the following values:
EXCHEXT_UNICODE
The lpszFile parameter is a unicode string.
EEAFE_OPEN
The attachment is being opened.
EEAFE_PRINT
The attachment is being printed.
EEAFE_QUICKPREVIEW
The attachment is being quickviewed.

Return Values

S_OK
The extension object replaced Microsoft Exchange behavior and opened the file on its own. Microsoft Exchange will consider the task handled.
S_FALSE
The extension object did nothing or added additional behavior. Microsoft Exchange will continue to call extensions or, if necessary, open the file attachment itself.

Remarks

Microsoft Exchange calls the IExchExtAttachedFileEvents::OnOpenSzFile method when it is about to open an attachment, but was not able to open it directly from the data in the attachment in the message. When this occurs, the attachment data is written to an intermediate file. Microsoft Exchange attempts to find an application that is registered to handle the attached file's class. If it finds it, the application is started and prompted to open the attachment.

If an error occurs, OnOpenSzFile should display an error message and return an error. Microsoft Exchange will not continue to try and open the attachment, nor will it display an error message, but will stop the user action that requested the attachment be opened.