Microsoft KB Archive/296726

= PRB: ContentClass and Custom Properties Not Supported at Attachment Body Part =

Article ID: 296726

Article Last Modified on 2/22/2007

-

APPLIES TO


 * Microsoft Exchange 2000 Server Standard Edition
 * Collaboration Data Objects for Exchange 2000
 * Microsoft ActiveX Data Objects 2.5

-



This article was previously published under Q296726



SYMPTOMS
Messages that are formatted according to the Multipurpose Internet Mail Extensions (MIME) specification are divided into parts. The top part is referred to as the root, and additional parts are referred to as body parts. You can set the content class and the custom property on the attachment body part. When the sendusing field is set to the cdoSendUsingExchange enumeration, the content class and custom property do not persist to the MIME stream of the received message.



CAUSE
Setting the content class and custom properties is not supported on the attachment body part level. Setting these properties is only supported at the root of the message.



STATUS
This behavior is by design.



Steps to Reproduce Behavior
 In Microsoft Visual Basic, create a new Standard EXE project.  Add a button to the default form and paste the following code into the button's Click event: Dim iMsg As CDO.Message Dim iConf As CDO.Configuration Dim iBp As CDO.IBodyPart Dim Flds As Fields Dim Strm As Stream Set iMsg = CreateObject(&quot;CDO.Message&quot;) Set iConf = iMsg.Configuration iConf(&quot;http://schemas.microsoft.com/cdo/configuration/sendusing&quot;) _ = cdoSendUsingExchange iConf.Fields.Update 'TO DO: Change From and To   iMsg.To = &quot;someone@somewhere.com&quot; iMsg.From = &quot;someone@somewhere.com&quot; iMsg.Subject = &quot;subject&quot; iMsg.TextBody = &quot;text body&quot; Set iBp = iMsg.AddAttachment(&quot;&quot;) iBp.ContentClass = &quot;urn:somewhere:mycc&quot; Set Flds = iBp.Fields Flds(&quot;urn:schemas:mailheader:content-type&quot;) = &quot;text/html&quot; Flds(&quot;urn:schemas:mailheader:content-class&quot;) = &quot;urn:somewhere:mycc&quot; Flds(&quot;urn:schemas:mailheader:mycustomprop&quot;) = &quot;myproperty&quot; Flds.Update Set Strm = iBp.GetDecodedContentStream Strm.WriteText &quot;Attachment body part new text&quot;, adWriteLine Strm.Flush iMsg.Fields.Update iMsg.Send Set iMsg = Nothing  Change the e-mail address of iMsg.To and iMsg.From in the code. Add a reference to Microsoft CDO For Exchange 2000 Library and Microsoft ActiveX Data Objects 2.5 Library. Run the program and click the button to send the message. Observe the MIME stream of the received message. The attachment body part's ContentClass property and urn:schemas:mailheader:mycustomprop custom property are not persisted.</li></ol>

Keywords: kbmsg kbprb KB296726

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.