none
Problem with outlook 2003 addin RRS feed

  • Question

  • I need create a commandbar when user open a new appointmentitem, and now the question is how to make the commandbar and the appointment is bijection, I mean, each operation of the commandbar can only response to its only appointment item.

    Thanks.

    Monday, July 23, 2012 3:25 AM

Answers

  • The important thing is that each control you add (CommandBarButton, CommandBarPopup) has a unique Tag property. If all controls in open items have the same Tag property a click in one will fire in all instances.
     
    You can do what Damian suggests and generate a unique Guid for each control. What I do is use a base tag value that's descriptive, such as "CustomConferenceButton", then I add a key value that gets incremented for each new item that's created in that Outlook session. So the first Inspector would add "1" to each control's Tag, the next "2", and so on.
     
    Also, make sure to create your controls and other UI with the Temporary property set to True so you don't get unwanted UI persistence.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "SaraZC" <=?utf-8?B?U2FyYVpD?=> wrote in message news:caa93c9b-e6ac-4508-9e8c-bcfa9f3d74dd...

    Dear DamianD,

    Thanks first.

    But I am wondering what you mean about ".Tab property"....

    And guids will do fine suggested that I should use guids? whose guids?


    Ken Slovak MVP - Outlook
    Monday, July 23, 2012 2:20 PM

All replies

  • you have to set .Tab property to unique value on each opened window where you add your command bar (guids will do fine).
    Monday, July 23, 2012 8:27 AM
  • Dear DamianD,

    Thanks first.

    But I am wondering what you mean about ".Tab property"....

    And guids will do fine suggested that I should use guids? whose guids?

    Monday, July 23, 2012 12:00 PM
  • sorry for misslepping, i was thinking about Tag property on command bar object. and for guids - guids that you generate on the fly.

    Monday, July 23, 2012 12:23 PM
  • The important thing is that each control you add (CommandBarButton, CommandBarPopup) has a unique Tag property. If all controls in open items have the same Tag property a click in one will fire in all instances.
     
    You can do what Damian suggests and generate a unique Guid for each control. What I do is use a base tag value that's descriptive, such as "CustomConferenceButton", then I add a key value that gets incremented for each new item that's created in that Outlook session. So the first Inspector would add "1" to each control's Tag, the next "2", and so on.
     
    Also, make sure to create your controls and other UI with the Temporary property set to True so you don't get unwanted UI persistence.

    --
    Ken Slovak
    [MVP-Outlook]
    http://www.slovaktech.com
    Author: Professional Programming Outlook 2007
    "SaraZC" <=?utf-8?B?U2FyYVpD?=> wrote in message news:caa93c9b-e6ac-4508-9e8c-bcfa9f3d74dd...

    Dear DamianD,

    Thanks first.

    But I am wondering what you mean about ".Tab property"....

    And guids will do fine suggested that I should use guids? whose guids?


    Ken Slovak MVP - Outlook
    Monday, July 23, 2012 2:20 PM