Platform SDK: Exchange 2000 Server |
[This is preliminary documentation and subject to change.]
Adds a new BodyPart object to the collection.
[Visual Basic] Function Add([ByVal Index as Long = -1]) as IBodyPart [C++] HRESULT Add( long Index = -1, IBodyPart** pVal); [IDL] HRESULT Add( [in, defaultvalue(-1), optional] long Index, [out,retval] IBodyPart** pVal );
Index allows a BodyPart object to be inserted into a specific location in the collection.
If an object already exists in the collection with the index you specify, then that object and all following objects have their index increased by one, and the object is then inserted. Insertion with the Add method does not replace the object at the index you specify.
The content-type for the newly added BodyPart object defaults to "application/octet-stream".
The content-disposition for the newly added BodyPart object defaults to "attachment" if the BodyParts collection contains attachments. (i.e. it was retrieved using an Attachments property on another object, such as the Message object.) The "filename" attribute parameter, however, is not set automatically.
Dim iMsg as New CDO.Message Dim iBp as IBodyPart Dim iBps as IBodyParts Set iBps = iMsg.BodyPart.BodyParts Set iBp = iBps.Add ...