outlook toolbar created everytime i open outlook

  • Thread starter Thread starter Anushya
  • Start date Start date
A

Anushya

Hi
I am creating a outlook addins and in that OnConnection i am creating
a toolbar(Commandbars). the code is working fine..

But the problem is whenever i restart outlook, it is creating a new
toolbar..

Wot is the change i need to do??

Pls let me know immediately
Anushya
 
Hi,

you should parse the toolbar collection to see if your toolbar is allready
there. If so don't create it again.
ActiveExplorer.CommandBars.Item("MyCmdBar")
 
Either check if your toolbar is already there and delete it or (even better)
create your toolbar as temporary (CommandBars.Add(...Temporary:=true, ...)),
this way Outlook will not persist it between the sessions.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Hi v_anushya,

Try modifying your code to get the existing Outlook object to check
for the Commandbar that you have already created. Bypass the creation
process if the Commandbar already exists .

~~~~~~~~~~~~~
Tommie Carter
 
Thanks Dmitry
It works fine.
Anushya
Dmitry Streblechenko said:
Either check if your toolbar is already there and delete it or (even better)
create your toolbar as temporary (CommandBars.Add(...Temporary:=true, ...)),
this way Outlook will not persist it between the sessions.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top