none
Setting SMILbody property fails. RRS feed

  • Question

  • I'm writing some C# code to create an MMS in Outlook (version 2016 desktop is current test platform). Most things are working well except when I try to set the SMILbody property an (unhelpful) exception is thrown "The operation failed" with HRESULT 0xDAC04005.

    I know the property is marked as "deprecated" in the Office 2013 MSDN docs, but many other properties are marked like this and work just fine. Also, the HRESULT error code changes if I put in an invalid string or bad XML etc. Even the Office 2010 sample code for SMILbody fails too.

    Does something else need to be done to enable this or is there a MAPI alternative?

    The docs on the SMILbody format are nearly non-existent.

    Another side issue is that calling:  Application.CreateItem(  Outlook.OlItemType.olMobileItemMMS) fails with an exception (BAD_PARAM) so I have to use olMobileItemSMS and then change the message class to MMS later via MAPI.

    Thanks for any suggestions.

    Saturday, July 9, 2016 12:48 PM

Answers

  • >>>Even the Office 2010 sample code for SMILbody fails too.

    According to your description, I have made a sample to try to reproduce this issue, unfortunately, I can't.
    Sub DemoMobileItem()
     Dim myMobileItem As MobileItem
     
     Dim myAttachment, myAttachment1, myAttachment2 As Outlook.Attachment
     
     Set myMobileItem = CreateItem(olMobileItemMMS)
     
     Set myAttachment1 = myMobileItem.Attachments.Add("C:\New folder\test.txt", olByValue)
     
     ' Sets the PidTagAttachContentId property of the attachment.
     
     myAttachment1.PropertyAccessor.SetProperty "http://schemas.microsoft.com/mapi/proptag/0x3712001F", "att0.txt"
     
     myMobileItem.SMILBody = "<?xml version=""1.0"" standalone=""yes""?>" & _
    "<smil><head><meta name=""author"" content=""MSOfficeOlkOMS""/>" & _
    "<layout><root-layout width=""128"" height=""128"" background-color=""#000000""/>" & _
    "<region id=""Image"" left=""0%"" top=""0%"" width=""100%"" height=""75%"" fit=""slice""/>" & _
    "<region id=""Text"" left=""0%"" top=""75%"" width=""100%"" height=""25%"" fit=""slice""/>" & _
    "</layout></head><body><par dur=""invalid""><img src=""att1.jpg"" region=""Image""/>" & _
    "<text src=""att0.txt"" region=""Text""/></par></body></smil>"
     
     myMobileItem.Save
     
     myMobileItem.Display
    End Sub

    Outlook version:


    For more information, click here to refer about MobileItem.SMILBody Property (Outlook)

    So I suggest that you could provide more information about your issue, for example screenshot, sample code etc., that will help us reproduce and resolve it.

    Thanks for your understanding.
    • Proposed as answer by David_JunFeng Monday, July 18, 2016 3:02 AM
    • Marked as answer by David_JunFeng Tuesday, August 2, 2016 2:53 PM
    Monday, July 11, 2016 5:24 AM