PRB: ContentClass and Custom Properties Not Supported at Attachment Body Part (296726)



The information in this article applies to:

  • Microsoft Exchange 2000 Server
  • Collaboration Data Objects for Exchange 2000
  • ActiveX Data Objects (ADO) 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.

MORE INFORMATION

Steps to Reproduce Behavior

  1. In Microsoft Visual Basic, create a new Standard EXE project.
  2. 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("CDO.Message")
        Set iConf = iMsg.Configuration
        iConf("http://schemas.microsoft.com/cdo/configuration/sendusing") _
            = cdoSendUsingExchange
        iConf.Fields.Update
        
        'TO DO: Change From and To
        iMsg.To = "someone@somewhere.com"
        iMsg.From = "someone@somewhere.com"
        iMsg.Subject = "subject"
        iMsg.TextBody = "text body"
        Set iBp = iMsg.AddAttachment("")
        iBp.ContentClass = "urn:somewhere:mycc"
        Set Flds = iBp.Fields
        Flds("urn:schemas:mailheader:content-type") = "text/html"
        Flds("urn:schemas:mailheader:content-class") = "urn:somewhere:mycc"
        Flds("urn:schemas:mailheader:mycustomprop") = "myproperty"
        Flds.Update
        Set Strm = iBp.GetDecodedContentStream
        Strm.WriteText "Attachment body part new text", adWriteLine
        Strm.Flush
        iMsg.Fields.Update
        iMsg.Send
        Set iMsg = Nothing
     
    					
  3. Change the e-mail address of iMsg.To and iMsg.From in the code.
  4. Add a reference to Microsoft CDO For Exchange 2000 Library and Microsoft ActiveX Data Objects 2.5 Library.
  5. Run the program and click the button to send the message.
  6. 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.

Modification Type:MinorLast Reviewed:8/25/2005
Keywords:kbMsg kbprb KB296726