none
Access outlook custom form data field from VSTO RRS feed

  • Question

  • Hi,

    I have some trouble with an Outlook custom form for Outlook Appointment.

    The point is that form was developed with Outlook 2003 and use a deprecated method to call vba macro from vbs.(see http://social.msdn.microsoft.com/Forums/en-MY/outlookdev/thread/54dafc75-04d6-4d59-85cf-4a9f5228fb03)

    So i develop a new Add-In form with VSTO to replace the old one... and that's ok !

    The problem is that I want to open my new Add-in form with all the data that contain the "old" appointment. Not only the standard appointment field but also with the custom field I add to my old form.

    e.g.  :

    In my "old" appointment i add a fields called "Driver", how can I access that data with my new Add-in form ?

    It don't seems to appear in Appointment.ItemProperties or Appointment.UserProperties

    Any advice greatly appreciated !

    Thanks

    Tuesday, July 12, 2011 9:56 AM

Answers

  • A control (textbox, checkbox, label, etc.) on a form is only a control and doesn't actually store any data. The data is stored in a field of the item, in this case the UserProperty "DriverValue". That is what's known as a "bound control".
     
    To access the data you would use Appointment.UserProperties.Item("DriverValue").

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "julien.senn" <=?utf-8?B?anVsaWVuLnNlbm4=?=> wrote in message news:e6a5b20e-cf6a-4273-b024-1018e78cc204...

    Thank you for your answer

    It's a text field named "Driver" that i add to the form with the "Control Tool Box" and originally i create a new field called "DriverValue" in the text field properties with the New... bouton (see pict bellow, sorry it's in french)

    My question is : I develop a new Add-In form that replace the old one and when I open an old appointment, I can access all the data that are standard (Location, Duration,...) with Appointment.ItemProperties but how can i access the data in a user defined field ?

    Thanks

    pict

    Ken Slovak MVP - Outlook
    • Marked as answer by julien.senn Wednesday, July 13, 2011 12:23 PM
    Tuesday, July 12, 2011 2:52 PM

All replies

  • Is that a field on the item, or just a control on the custom form? Is that Driver property bound to an Outlook property? How did you add Driver originally?

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "julien.senn" <=?utf-8?B?anVsaWVuLnNlbm4=?=> wrote in message news:b00271c3-669e-4e5f-a1e7-65b4f1262a08...

    Hi,

    I have some trouble with an Outlook custom form for Outlook Appointment.

    The point is that form was developed with Outlook 2003 and use a deprecated method to call vba macro from vbs.(see http://social.msdn.microsoft.com/Forums/en-MY/outlookdev/thread/54dafc75-04d6-4d59-85cf-4a9f5228fb03)

    So i develop a new Add-In form with VSTO to replace the old one... and that's ok !

    The problem is that I want to open my new Add-in form with all the data that contain the "old" appointment. Not only the standard appointment field but also with the custom field I add to my old form.

    e.g.  :

    In my "old" appointment i add a fields called "Driver", how can I access that data with my new Add-in form ?

    It don't seems to appear in Appointment.ItemProperties or Appointment.UserProperties

    Any advice greatly appreciated !

    Thanks


    Ken Slovak MVP - Outlook
    Tuesday, July 12, 2011 1:23 PM
  • Thank you for your answer

    It's a text field named "Driver" that i add to the form with the "Control Tool Box" and originally i create a new field called "DriverValue" in the text field properties with the New... bouton (see pict bellow, sorry it's in french)

    My question is : I develop a new Add-In form that replace the old one and when I open an old appointment, I can access all the data that are standard (Location, Duration,...) with Appointment.ItemProperties but how can i access the data in a user defined field ?

    Thanks

    pict
    Tuesday, July 12, 2011 2:45 PM
  • A control (textbox, checkbox, label, etc.) on a form is only a control and doesn't actually store any data. The data is stored in a field of the item, in this case the UserProperty "DriverValue". That is what's known as a "bound control".
     
    To access the data you would use Appointment.UserProperties.Item("DriverValue").

    --
    Ken Slovak
    MVP - Outlook
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
     
     
    "julien.senn" <=?utf-8?B?anVsaWVuLnNlbm4=?=> wrote in message news:e6a5b20e-cf6a-4273-b024-1018e78cc204...

    Thank you for your answer

    It's a text field named "Driver" that i add to the form with the "Control Tool Box" and originally i create a new field called "DriverValue" in the text field properties with the New... bouton (see pict bellow, sorry it's in french)

    My question is : I develop a new Add-In form that replace the old one and when I open an old appointment, I can access all the data that are standard (Location, Duration,...) with Appointment.ItemProperties but how can i access the data in a user defined field ?

    Thanks

    pict

    Ken Slovak MVP - Outlook
    • Marked as answer by julien.senn Wednesday, July 13, 2011 12:23 PM
    Tuesday, July 12, 2011 2:52 PM
  • Ok Thanks,

    I try with userProperty but I had some trouble than I try with

    Appointment.PropertyAccessor.GetProperty("http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/DriverValue");

    Appointment.PropertyAccessor.SetProperty("http://schemas.microsoft.com/mapi/string/{FFF40745-D92F-4C11-9E14-92701F001EB3}/DriverValue", "Ben");

    Then that's OK !!

    Thanks
    Wednesday, July 13, 2011 12:22 PM