none
OOM property doesn't work for citrix deployment. RRS feed

  • Question

  • Hi,

    We have our CRM product Add-in for Microsoft Outlook, using which we set some custom CRM properties for an activity (Email, Appointments or Tasks).

    It has been observed that those custom properties returns "Null" values (exception saying that 'property not found') in Citrix deployment (XenApp 6.5), while the same works well on the other Operating Systems.

    I am trying to make a call to Outlook Object Model API in the following manner, for a mail item using property accessor & DASL schema:

    MailItem.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/PivotalCrmProperties").ToString(); 


    Where I am trying to access property for "PivotalCrmProperties" which works well in dedicated windows setup and fails with Citrix published client.

    Could somebody please help me in understanding why this does not work when Citrix is involved?

    I am hoping that we don't have any limitation from OOM property towards Citrix.

    Thanks & Regards,

    Pratik Prakash.



    Monday, August 21, 2017 8:43 PM

All replies

  • Is it possible, as the exception suggests, that the property is simply not present on the item?

    How do you retrieve the item?

    Do you see the property in OutlookSpy if you select the problematic item and click the IMessage button?


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Monday, August 21, 2017 10:34 PM
  • Hello Pratik,

    Most probably the property doesn't exist. Try using any low-level property viewer for exploring hidden properties at runtime. For example, you may use MFCMAPI (open-source) and OutlookSpy for that.

    I have found that the property comes form the Pivotal CRM which may not be installed and running in Outlook. Is that the case?


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

    Tuesday, August 22, 2017 4:46 AM
  • Hi Dmitry,

    I am able to see the property in OutlookSpy and I am able to get the property using low level MAPI code.

    I am also sure that, the same can be achieved by using Redemption.

    But, I want a way to access the property using OOM as it works well in case of other operating systems, and gives an exception in case of citrix.

    Thanks,

    Pratik

    Tuesday, August 22, 2017 5:29 AM
  • Hi Eugene,

    I have the Pivotal CRM add-in installed and the property comes from the same.

    I am able to view the property using Outlook spy, and get the property using low-level MAPI code, but I want to achieve the same using OOM as it works well in case of other operating systems and fails in citrix.

    Any help towards that will be much appreciated.

    Thanks, 

    Pratik Prakash.

    Tuesday, August 22, 2017 5:33 AM
  • Pratik,

    and gives an exception in case of citrix.

    What property or method exactly generates an exception?

    Try to break the chain of property and method calls and declare a property or method on a single line of code. Thus, you will be able to find the exact property or method which fires an exception. 

    Also it is not clear when and where you are trying to get the property value. I'd suggest calling Save method before getting the property value to make sure all changes made by other add-ins are saved to the store so you can access them.

    Is it a multi-valued property or binary property?

    A multi-valued property (Microsoft Visual Basic type VT_ARRAY) is stored as a two-dimensional array that contains the same number of elements as are there are values in the property. Getting a multi-valued property will return a VT_ARRAYvalue. When setting a multi-valued property, pass a two-dimensional array ( VT_ARRAY) with one element for each value that you want to set for the property.

    A binary property (MAPI type PT_BINARY) is stored as an array of bytes rather than a string. Getting a binary property will return a value of type VT_ARRAY. The GetPropertySetPropertyGetProperties, and SetProperties methods do not perform any conversion between binary array and string. Use the helper methods PropertyAccessor.BinaryToStringand PropertyAccessor.StringToBinary to explicitly perform any conversion.

    Read more about that in the Best Practices for Getting and Setting Properties article.


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

    Tuesday, August 22, 2017 5:41 AM
  • Pratik,

    Please see my reply to you above.


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

    Tuesday, August 22, 2017 5:41 AM
  • Hi Eugene,

    Few Details about the "PivotalCrmProperties" which generates a property not found exception:

    Value:AAEAAAD/////AQAAAAAAAAAMAgAAAFhQaXZvdGFsLk9mZmljZS5Db21tb24sIFZlcnNpb249Ni4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj0xZWY0NDViNTliOWVjZTYwBQEAAAAuQ2RjU29mdHdhcmUuUGl2b3RhbC5PZmZpY2UuVXRpbGl0eS5EYXRhQ29udGV4dAIAAAAIbV9wYXJlbnQGbV9kYXRhBAMuQ2RjU29mdHdhcmUuUGl2b3RhbC5PZmZpY2UuVXRpbGl0eS5EYXRh
    Kind: MNID_STRING
    Type: PT_UNICODE
    Tag num: 0x8039001F

    Above value has been obtained on windows OS using OutlookSpy.

    I am trying to access the property while creating a new activity (mail, appointment or task), and I also force save the item before fetching the property.

    Please do let me know if I am missing something here.



    Thanks,

    Pratik.


    Tuesday, August 22, 2017 6:58 AM
  • Are you sure your code is working with the right item? Does the following script display the correct value if you run it in OutlookSpy (click Script, paste the script, click Run)?

    set item = Application.ActiveExplorer.Selection(1)
    MsgBox item.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/PivotalCrmProperties")
    


    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Tuesday, August 22, 2017 4:19 PM
  • Hi Dmitry,

    If I run the above script in OutlookSpy, I get following error:

    DISP_E_Exception, the property is unknown or cannot be found.

    But, I can see the correct value of the property (PivotalCrmProperties), when I click on IMessage in OutlookSpy for the same mailItem.





    Wednesday, August 23, 2017 6:35 AM
  • What property or method exactly fires an exception in the code?

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

    Wednesday, August 23, 2017 12:34 PM
  • Does OutlookSpy show the same DASL property name as the one used in your code?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, August 23, 2017 1:27 PM
  • Yes, both are the same.
    Wednesday, August 23, 2017 1:45 PM
  • What is the exact DASL name you are using?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, August 23, 2017 3:04 PM
  • http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/PivotalCrmProperties/

    Same as mentioned in previous comments as well.

    Wednesday, August 23, 2017 3:42 PM
  • Try to get rid of the last "/"

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, August 23, 2017 3:49 PM
  • In my code, I am using it as below:

    http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/PivotalCrmProperties

    I guess the due to the HTML editor here, the last '/' got added.


    Wednesday, August 23, 2017 3:55 PM
  • Does the GUID match what OutlookSpy shows?

    Dmitry Streblechenko (MVP)
    http://www.dimastr.com/redemption
    Redemption - what the Outlook
    Object Model should have been
    Version 5.5 is now available!

    Wednesday, August 23, 2017 4:41 PM
  • Yes, I have already cross-checked all the details in my code with the values obtained from OutlookSpy.

    I guess I will be raising this issue with Citrix, as we have not been able to figure out any solution here.

    Thursday, August 24, 2017 4:11 AM
  • Hi altogether,

    I'd like to add to the conversation that we're experiencing a similar situation with a self-created property, using PropertyAccessor.

    On a Windows Client OS the code works as expected and without errors whereas the same MailItem accessed within a Citrix session throws an exception that the scheme doesn't exist. Running the code in C# and VBScript (in OutlookSpy) gives same exception DISP_E_Exception. Here are the code snippets we use:

    Create user property (Client OS):

    loAccessor = MailItem.PropertyAccessor
    loAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{" + ;
      THIS.cGuidOfficeAddin + "}/" + lcKey, tuValue)

    Because of lack of WMI on Windows Server versions and to avoid the Outlook security dialog, we also had to extend this by using the following VBScript code:

    propTag = MailItem.GetIDsFromNames("{<<THIS.cGuidOfficeAddin>>}", "<<lcKey>>")
    propTag = propTag or &H1F 'the type is PT_UNICODE
    MailItem.Fields(propTag) = "<<TRANSFORM(tuValue)>>"
    

    At that stage the proptag is visible and accessible in the Outlook MailItem.

    Here's the C# code we use in our Add-in to read the property:

    propertyAccessor = mailItem.PropertyAccessor;
    value = propertyAccessor.GetProperty(@"http://schemas.microsoft.com/mapi/string/{" + guid + "}/" + propertyKey);
    

    GUID and property name used in all 3 snippets are the same.

    Running the same code(s) in a Citrix session throws the above mentioned exception. According to MSDN it seems that there are "blocked properties". See here: https://msdn.microsoft.com/en-us/library/bb147570.aspx

    And the property doesn't not appear in OutlookSpy IMessage dialog.

    Additionally, I saw another forum thread about this problem where the original poster mentioned that they had to change "security policies" to make it work in Citrix. Unfortunately, it was neither described which policies and I don't find the thread anymore. :(

    Does anyone have details about those security policies (I assume they are Group Policies - GPOs).

    Regards, Jochen


    Enjoy AFP FAQ - Participate AfpWiki - Get Blogged by JoKi

    Friday, August 25, 2017 8:20 AM
  • I am able to reproduce the issue on "Windows Server 2012 R2" operating system as well.
    Friday, September 1, 2017 5:04 AM
  • Hi Pratik Prakash,

    If you are available with Office Insider then there is an option to provide feedbacks to engineers regarding the outlook issues.

    if you are not available with Office insider then you can also submit your feedback to Outlook user voice.

    Outlook Feedback

    with the office insider Developers get the feedback directly.

    Regards

    Deepak


    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.

    Friday, September 1, 2017 6:39 AM
    Moderator
  • Thank you for the information Deepak !
    Friday, September 1, 2017 7:22 PM