Share via


IMessage::OpenAttach

The OpenAttach method opens an attachment.

Syntax

HRESULT OpenAttach (
  ULONG ulAttachmentNum,
  LPCIID lpInterface,
  ULONG ulFlags,
  LPATTACH FAR * lppAttach
);

Parameters

  • ulAttachmentNum
    [in] Index number of the attachment to open, specified by the lpulAttachmentNum parameter of IMessage::CreateAttach from when the attachment was created.
  • lpInterface
    [in] Ignored.
  • ulFlags
    [in] Ignored.
  • lppAttach
    [out] Reference to the open attachment.

Return Value

This method returns the standard values E_INVALIDARG, E_OUTOFMEMORY, E_UNEXPECTED, and E_FAIL, as well as the following:

  • S_OK
    Indicates success.

Remarks

To open an attachment, you must have access to its attachment number. Call GetAttachmentTable to retrieve the message's attachment table and locate the row that represents the attachment to be opened.

Do not try to open one attachment multiple times; the results are undefined and dependent on the message store provider.

Attachments are always in the read/write mode.

Requirements

Smartphone: Windows Mobile 2002 and later
OS Versions: Windows CE 3.0 and later
Header: mapidefs.h
Library: cemapi.lib

See Also

IMessage

Messaging

Last updated on Friday, April 22, 2005

© 2005 Microsoft Corporation. All rights reserved.

Send feedback on this topic to the authors.