Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Attaches the contents of a file to the message.
Syntax
HRESULT AttachFileW(
[in] LPCWSTR pwszFilePath,
[in] IStream *pstmFile,
[out] LPHBODY phBody
);
Parameters
-
pwszFilePath [in]
-
Type: LPCWSTR
Specifies the path and filename of the file to attach. When pstmFile is NULL, pwszFilePath is used to indicate the file to attach, in which case the file must exist and MimeOLE must have read access to it. Otherwise, pwszFilePath is used only to indicate the filename of the attached file, which might not exist.
-
pstmFile [in]
-
Type: IStream*
Specifies a pointer to the IStream object for the file to attach. MimeOLE increments the reference count for this object and does not release it until the whole message object is freed or until HandsOffStorage is called.
-
phBody [out]
-
Type: LPHBODY
Receives the handle of the new body.
Return value
Type: HRESULT
Returns one of the following values.
| Return code | Description |
|---|---|
|
Indicates success. |
|
Indicates that an unknown error has occurred. |
|
Indicates that pwszFilePath is NULL. |
|
Indicates an attempt to allocate memory failed. |
Requirements
| Minimum supported client |
Windows XP [desktop apps only] |
| Minimum supported server |
Windows Server 2003 [desktop apps only] |
| Product |
Outlook Express 6.0 |
| Header |
|
| IDL |
|
| DLL |
|