ITnef::AddProps

The ITnef::AddProps method allows the calling service provider or gateway to add properties to the encapsulation of a message or an attachment.

Quick Info

See ITnef : IUnknown.

HRESULT AddProps(
  ULONG ulFlags,              
  ULONG ulElemID,             
  LPVOID lpvData,             
  LPSPropTagArray lpPropList  
);
 

Parameters

ulFlags
[in] Bitmask of flags that controls how properties are included in or excluded from encapsulation. The following flags can be set:
TNEF_PROP_ATTACHMENTS_ONLY
Encodes only the properties in the lpPropList parameter that are part of attachments within the message.
TNEF_PROP_CONTAINED
Encodes only properties from the attachment specified by the ulElemID parameter. If the lpvData parameter is non-null, the data pointed to is written into the attachment's encapsulation in the file indicated by the PR_ATTACH_TRANSPORT_NAME property.
TNEF_PROP_CONTAINED_TNEF
Encodes only properties from the message or attachment specified by ulElemID. If this flag is set, the value in lpvData must be an ISTREAMTNEF pointer.
TNEF_PROP_EXCLUDE
Encodes all properties not specified in lpPropList.
TNEF_PROP_INCLUDE
Encodes all properties specified in lpPropList.
TNEF_PROP_MESSAGE_ONLY
Encodes only those properties specified in lpPropList that are part of the message itself.
ulElemID
[in] An attachment's PR_ATTACH_NUM property, which holds a number that uniquely identifies the attachment within its parent message. The ulElemID parameter is used when special handling is requested for an attachment. The ulElemID parameter should be zero unless the TNEF_PROP_CONTAINED or TNEF_PROP_CONTAINED_TNEF flag is set in the ulFlags parameter.
lpvData
[in] Pointer to attachment data used to replace the data of the attachment specified in ulElemID. The lpvData parameter should be NULL unless TNEF_PROP_CONTAINED or TNEF_PROP_CONTAINED_TNEF is set in ulFlags.
lpPropList
[in] Pointer to the list of properties to include in or exclude from encapsulation.

Return Values

S_OK
The call succeeded and has returned the expected value or values.

Remarks

Transport providers, message store providers, and gateways call the ITnef::AddProps method to list properties to be included in or excluded from the TNEF encapsulation of a message or an attachment. Using successive calls, the provider or gateway can specify a list of properties to add and encode or to exclude from being encoded. Providers and gateways can also use AddProps to provide information on any special handling attachments should be given.

AddProps is only supported for TNEF objects opened with the TNEF_ENCODE flag for the OpenTnefStream or OpenTnefStreamEx function.

Note that no actual TNEF encoding happens for AddProps until the ITnef::Finish method is called. This functionality means that pointers passed into AddProps must remain valid until after the call to Finish is made. At that point, all objects and data passed in with AddProps calls can be released or freed.

See Also

ITnef::Finish, OpenTnefStream, OpenTnefStreamEx, PR_ATTACH_TRANSPORT_NAME