none
Outlook 2007 & 2013 - vbscript to extract items in public folder RRS feed

  • Question

  • i have a vbscript to extract items in public folder for creating a text file (it uses as html)

    so far it is reliable for years.

    but i find the vbscript will error when meeting item with this character 「」

    i am not sure how the user type this open/close bracket.  it may be copied from excel symbol.

    any help?   Thanks  a lot.

    • Moved by Steve Fan Tuesday, January 7, 2014 3:20 AM coding problem
    Monday, January 6, 2014 5:07 AM

Answers

  • Hello TW88,

    You need to use the RTFBody property which returns a Byte array that represents the body of the Microsoft Outlook item in Rich Text Format. Then you need to convert RTF to HTML. Please read more about possible ways of converting in the Convert Rtf to HTML forum.

    What code do you use for converting?


    • Edited by Eugene Astafiev Tuesday, January 7, 2014 8:36 AM
    • Marked as answer by TW88 Saturday, January 11, 2014 1:49 AM
    Tuesday, January 7, 2014 8:35 AM

All replies

  • Hi,

    Would you please attach the exact content of the vbscript so that we can provide further assitance?

    Since we are not the best resource for coding, I'll move your post to Outlook for Developers forum:

    https://social.msdn.microsoft.com/Forums/office/en-US/home?forum=outlookdev

    The reason why we recommend posting appropriately is you will get the most qualified pool of respondents, and other partners who read the forums regularly can either share their knowledge or learn from your interaction with us. Thank you for your understanding.

    Regards,

    Steve Fan
    TechNet Community Support

    Tuesday, January 7, 2014 3:19 AM
  • Hi,

    What did you get the error message? I think the error may be caused by the specific code to the operation of the strings by VBScript rather than the properties of Outlook meeting item. Would you mind share the code to troubleshoot this issue?

    Best regards

    Fei


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, January 7, 2014 8:03 AM
    Moderator
  • Hello TW88,

    You need to use the RTFBody property which returns a Byte array that represents the body of the Microsoft Outlook item in Rich Text Format. Then you need to convert RTF to HTML. Please read more about possible ways of converting in the Convert Rtf to HTML forum.

    What code do you use for converting?


    • Edited by Eugene Astafiev Tuesday, January 7, 2014 8:36 AM
    • Marked as answer by TW88 Saturday, January 11, 2014 1:49 AM
    Tuesday, January 7, 2014 8:35 AM
  • Thanks a lot.

    RTFbody returns lots of string.  Finally i gave up

    it only support meeting body, i need to retrieve its subject

    it only support office 2010 and 2013

    my platform is office 2007 

    Saturday, January 11, 2014 1:52 AM
  • Hi TW88,

    If you need to support Outlook 2007 you can use the PropertyAccessor class for getting and setting the rtf markup. It provides the ability to create, get, set, and delete properties on Outlook objects. 

    The AppointmentItem/MeetingItem classes provide the PropertyAccessor property which returns an instance of the corresponding class. You just need to use the DASL property - "http://schemas.microsoft.com/mapi/proptag/0x10090102" (corresponds to the PR_RTF_COMPRESSED property tag). For example, the following sample code shows how to get a property value:

    Sub DemoPropertyAccessorGetProperty()  
     Dim PropName, Header As String  
     Dim oMail As Object  
     Dim oPA As Outlook.PropertyAccessor  
     'Get first item in the inbox  
     Set oMail = _  
     Application.Session.GetDefaultFolder(olFolderInbox).Items(1) 
     
     'PR_TRANSPORT_MESSAGE_HEADERS  
     PropName = "http://schemas.microsoft.com/mapi/proptag/0x007D001E"  
     'Obtain an instance of PropertyAccessor class  
     Set oPA = oMail.PropertyAccessor  
     'Call GetProperty  
     Header = oPA.GetProperty(PropName)  
     Debug.Print (Header)  
    End Sub
    
    Be aware that the PR_RTF_COMPRESSED property doesn't accept or return strings. Instead, you need to set an array of bytes. Also you will get an array of bytes from the GetProperty method.
    Saturday, January 11, 2014 10:08 AM