A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

deleting CommandBars



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 29th 06, 08:12 PM posted to microsoft.public.outlook.program_addins
Mark J. McGinty
external usenet poster
 
Posts: 56
Default deleting CommandBars

Is there any good reason to delete all of the Controls in a CommandBar,
before deleting the CommandBar itself?

-Mark


  #2  
Old June 30th 06, 10:27 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default deleting CommandBars

I always just delete the command bar, but I also set it as temporary when I
create it.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...
Is there any good reason to delete all of the Controls in a CommandBar,
before deleting the CommandBar itself?

-Mark


  #3  
Old July 4th 06, 02:40 PM posted to microsoft.public.outlook.program_addins
Mark J. McGinty
external usenet poster
 
Posts: 56
Default deleting CommandBars


"Ken Slovak - [MVP - Outlook]" wrote in message
...
I always just delete the command bar, but I also set it as temporary when I
create it.


Thanks for the reply, Ken.

A couple more questions, if I may... The temporary flag prevents the
bar/button definition from being persisted? Wouldn't that tend to make
removal unnecessary?

I take it you don't pay any attention to RemoveMode when the AddIn
disconnects?


Thanks,
Mark






--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...
Is there any good reason to delete all of the Controls in a CommandBar,
before deleting the CommandBar itself?

-Mark






  #4  
Old July 4th 06, 03:23 PM posted to microsoft.public.outlook.program_addins
Mark J. McGinty
external usenet poster
 
Posts: 56
Default deleting CommandBars


"Mark J. McGinty" wrote in message
...

"Ken Slovak - [MVP - Outlook]" wrote in message
...
I always just delete the command bar, but I also set it as temporary when
I
create it.


Thanks for the reply, Ken.

A couple more questions, if I may... The temporary flag prevents the
bar/button definition from being persisted? Wouldn't that tend to make
removal unnecessary?

I take it you don't pay any attention to RemoveMode when the AddIn
disconnects?


Hmm, trying to remove them when (RemoveMode ext_dm_UserClosed) seems to
be a moot point, since that is the only way OnDisconnection fires while a
valid Explorer exists. I also noticed that removing CommandBars in
Explorer_Close fails with error: "The Explorer has been closed and cannot
be used for further operations. Review your code and restart Outlook."

I made both the buttons and the bars temporary (and manually deleted the old
bar.) The buttons go away when OL exits, but the bar persists, even when
the temp parameter to CommamdBars.Add is True.

Where do you remove your CommandBars?


-Mark



Thanks,
Mark






--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...
Is there any good reason to delete all of the Controls in a CommandBar,
before deleting the CommandBar itself?

-Mark








  #5  
Old July 5th 06, 03:07 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default deleting CommandBars

Is Outlook truly exiting? I never get persistent toolbars that weren't
supposed to be there. I do use Explorer.Close.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...

"Mark J. McGinty" wrote in message
...

"Ken Slovak - [MVP - Outlook]" wrote in message
...
I always just delete the command bar, but I also set it as temporary when
I
create it.


Thanks for the reply, Ken.

A couple more questions, if I may... The temporary flag prevents the
bar/button definition from being persisted? Wouldn't that tend to make
removal unnecessary?

I take it you don't pay any attention to RemoveMode when the AddIn
disconnects?


Hmm, trying to remove them when (RemoveMode ext_dm_UserClosed) seems to
be a moot point, since that is the only way OnDisconnection fires while a
valid Explorer exists. I also noticed that removing CommandBars in
Explorer_Close fails with error: "The Explorer has been closed and cannot
be used for further operations. Review your code and restart Outlook."

I made both the buttons and the bars temporary (and manually deleted the
old bar.) The buttons go away when OL exits, but the bar persists, even
when the temp parameter to CommamdBars.Add is True.

Where do you remove your CommandBars?


-Mark



Thanks,
Mark






--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...
Is there any good reason to delete all of the Controls in a CommandBar,
before deleting the CommandBar itself?

-Mark









  #6  
Old July 5th 06, 03:04 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default deleting CommandBars

It makes removal automatic, but with Outlook I'm a firm believer in belt
plus suspenders.

I don't pay attention to removal mode but if Outlook is exiting you won't
get an On_Disconnection event unless all of your Outlook objects have
already been released. A classic Catch-22 situation that's only now fixed in
Outlook 2007. So we monitor for Explorer.Close and Inspector.Close and if
there are no additional Explorers or Inspectors then Outlook is closing and
you release all your Outlook objects so On_Disconnection can fire.

If the user disconnects the addin I call my release code from
On_Disconnection and that checks to see if my global Outlook application
object has already been released. If so I just exit that procedure
gracefully.

One exception to the temporary rule is WordMail. Word doesn't honor the
temporary setting although it doesn't fire an error if you set it. So for
WordMail you must explicitly delete the buttons/toolbars you've added as
well as deal with the CustomizationContext so the user doesn't get your
buttons/toolbars when Word (not WordMail) is used and so the user doesn't
get a prompt to save Normal.dot when they exit if set to prompt for saving
changes to Normal.dot.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Mark J. McGinty" wrote in message
...

"Ken Slovak - [MVP - Outlook]" wrote in message
...
I always just delete the command bar, but I also set it as temporary when
I
create it.


Thanks for the reply, Ken.

A couple more questions, if I may... The temporary flag prevents the
bar/button definition from being persisted? Wouldn't that tend to make
removal unnecessary?

I take it you don't pay any attention to RemoveMode when the AddIn
disconnects?


Thanks,
Mark


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
deleting cache Alain Weiler Outlook Express 2 June 26th 06 01:22 AM
Newbie question to CommandBars Claus Schiroky Outlook and VBA 1 May 10th 06 06:01 AM
Outlook commandbars Radiohead Add-ins for Outlook 1 January 25th 06 02:35 PM
how to use the CommandBars Collection Jim B Outlook - Using Forms 0 January 22nd 06 12:46 AM
Deleting a Custom From Chaplain Doug Outlook - Using Forms 1 January 12th 06 04:25 AM


All times are GMT +1. The time now is 10:36 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.