none
[Outlook 2016 64bit]can we tag x-header on task/meeting/calendar item? RRS feed

  • Question

  • As you know, we tagg x-header(defined by customer, like x-itar=yes) on emali message and successed.

    But we used the same method to tag on other email item, like task, meeting, calendar, and failed.

    I want to konw can we tag x-header on these item(task, meeting, calendar)? If we can, how?

    Thank you in advance!

    Monday, May 15, 2017 5:58 AM

Answers

  • Hello Leo,

    The namespace url is the same. 

    I am not familiar with C++. Testing with VBA, the property could be set for a meetingitem.

    Sub Demo()
     Dim PropName,Header As String
     Dim item As Object
     Dim oPA As Outlook.PropertyAccessor
    Set item = Application.ActiveInspector.currentItem
    PropName = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/x-ms-exchange-organization-authmechanism"
    Set oPA = item.PropertyAccessor
    Header = oPA.GetProperty(PropName)
    Debug.Print Header
    'oPA.SetProperty PropName, Header + "tag"
    'Debug.Print oPA.GetProperty(PropName)
    '
    End Sub

    I also manually set X-headers for a meetingitem using Outlook Spy add-in. It works. I think you need to debug your code to check if the object is a meetingitem, and whether you could get these properties and check what error you get when you set properties.

    You may visit the following 

    Supporting Named Properties

    IMAPIProp::SaveChanges

    Saving MAPI Properties

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by LeoGe Thursday, June 1, 2017 12:00 PM
    Thursday, May 18, 2017 10:24 AM
    Moderator

All replies

  • We are developping a outlook plug-in.

    As you know, we tagg x-header(defined by customer, like x-itar=yes) on emali message and successed.

    But we used the same method to tag on other email item, like task, meeting, calendar, and failed.

    I want to konw can we tag x-header on these item(task, meeting, calendar)? If we can, how?

    Thank you in advance!

    Monday, May 15, 2017 5:56 AM
  • As you know, we tagg x-header(defined by customer, like x-itar=yes) on emali message and successed.

    But we used the same method to tag on other email item, like task, meeting, calendar, and failed.

    I want to konw can we tag x-header on these item(task, meeting, calendar)? If we can, how?

    Thank you in advance!

    Monday, May 15, 2017 5:59 AM
  • Hello Leo,

    What code do you use for other Outlook items? 

    Please remember that when you send an appointment to another person the actual type of the item in the ItemSend event handler will be a MeetingRequest, not AppointmentItem. 


    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Monday, May 15, 2017 12:38 PM
  • Hello,

    I suggest you download Outlook Spy to check these properties.

    According to my test result, we could only get and set the x-header for mailitems and meetingitems.

    Appointmentitem and taskitem don't have PR_TRANSPORT_MESSAGE_HEADERS property.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Tuesday, May 16, 2017 7:24 AM
    Moderator
  • Hello,

    I suggest you download Outlook Spy to check these properties.

    According to my test result, we could only get and set the x-header for mailitems and meetingitems.

    Appointmentitem and taskitem don't have PR_TRANSPORT_MESSAGE_HEADERS property.

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    Thank you Celeste.

    We using this url "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/

       (complete code was shown above) to set meeting and mailetiem x-header.

    But for meeting item, it is failed.

    Do you have any suggestion? Does the namespces url for meeting and mail item are same or different?

    Wednesday, May 17, 2017 10:04 AM
  • Hello Leo,

    The namespace url is the same. 

    I am not familiar with C++. Testing with VBA, the property could be set for a meetingitem.

    Sub Demo()
     Dim PropName,Header As String
     Dim item As Object
     Dim oPA As Outlook.PropertyAccessor
    Set item = Application.ActiveInspector.currentItem
    PropName = "http://schemas.microsoft.com/mapi/string/{00020386-0000-0000-C000-000000000046}/x-ms-exchange-organization-authmechanism"
    Set oPA = item.PropertyAccessor
    Header = oPA.GetProperty(PropName)
    Debug.Print Header
    'oPA.SetProperty PropName, Header + "tag"
    'Debug.Print oPA.GetProperty(PropName)
    '
    End Sub

    I also manually set X-headers for a meetingitem using Outlook Spy add-in. It works. I think you need to debug your code to check if the object is a meetingitem, and whether you could get these properties and check what error you get when you set properties.

    You may visit the following 

    Supporting Named Properties

    IMAPIProp::SaveChanges

    Saving MAPI Properties

    Regards,

    Celeste


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Marked as answer by LeoGe Thursday, June 1, 2017 12:00 PM
    Thursday, May 18, 2017 10:24 AM
    Moderator