![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hello,
I am developing an outlook add-in which requires a single toolbar with a single button being added to the MailEditor window. Upon debugging my project the first time, the button is created and all is well. However, after closing outlook and debugging again, a duplicate toolbar is added (with the button). This continues to happen and toolbar after toolbar is added. I manually remove the Add-In and restart Outlook and the buttons are still there, the only way to remove them is by restarting my PC, and it just happens again. How would I go about solving this problem? Thanks |
Ads |
#2
|
|||
|
|||
![]()
Always make sure to set the UI you create as temporary, and then delete it
before the relevant Explorer or Inspector closes. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Matt" wrote in message ... Hello, I am developing an outlook add-in which requires a single toolbar with a single button being added to the MailEditor window. Upon debugging my project the first time, the button is created and all is well. However, after closing outlook and debugging again, a duplicate toolbar is added (with the button). This continues to happen and toolbar after toolbar is added. I manually remove the Add-In and restart Outlook and the buttons are still there, the only way to remove them is by restarting my PC, and it just happens again. How would I go about solving this problem? Thanks |
#3
|
|||
|
|||
![]()
I'm fairly new to Outlook programming, how do I do that?
"Ken Slovak - [MVP - Outlook]" wrote: Always make sure to set the UI you create as temporary, and then delete it before the relevant Explorer or Inspector closes. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Matt" wrote in message ... Hello, I am developing an outlook add-in which requires a single toolbar with a single button being added to the MailEditor window. Upon debugging my project the first time, the button is created and all is well. However, after closing outlook and debugging again, a duplicate toolbar is added (with the button). This continues to happen and toolbar after toolbar is added. I manually remove the Add-In and restart Outlook and the buttons are still there, the only way to remove them is by restarting my PC, and it just happens again. How would I go about solving this problem? Thanks |
#4
|
|||
|
|||
![]()
The CommandBars.Add() method has a temporary argument, set it to True if you
create a new CommandBar object. The CommandBarControls.Add() method also has that argument available when you add a new control to a CommandBar (menu/toolbar). Also set that True. That's generally enough, but if for some reason Outlook doesn't correctly close or crashes a belt plus suspenders approach is to handle the Inspector.Close() event on any Inspector you are adding UI to, and the Explorer.Close() event on any Explorer you add UI to. In those event handlers you get your references to the controls and commandbars you added and call their Delete() method to delete them. There's lots of sample code in various languages at www.outlookcode.com that shows handling those Close() events and how to handle adding and removing UI. Take a look there for samples in your language. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Matt" wrote in message ... I'm fairly new to Outlook programming, how do I do that? |
#5
|
|||
|
|||
![]()
My commandbar was set as temporary but the button was not. Is this way correct:
button_1 = CType(newToolBar.Controls.Add(1, 1, Nothing, Nothing, True), Office.CommandBarButton) ? "Ken Slovak - [MVP - Outlook]" wrote: The CommandBars.Add() method has a temporary argument, set it to True if you create a new CommandBar object. The CommandBarControls.Add() method also has that argument available when you add a new control to a CommandBar (menu/toolbar). Also set that True. That's generally enough, but if for some reason Outlook doesn't correctly close or crashes a belt plus suspenders approach is to handle the Inspector.Close() event on any Inspector you are adding UI to, and the Explorer.Close() event on any Explorer you add UI to. In those event handlers you get your references to the controls and commandbars you added and call their Delete() method to delete them. There's lots of sample code in various languages at www.outlookcode.com that shows handling those Close() events and how to handle adding and removing UI. Take a look there for samples in your language. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Matt" wrote in message ... I'm fairly new to Outlook programming, how do I do that? |
#6
|
|||
|
|||
![]()
For optional missing values use System.Reflection.Missing.Value instead of
using Nothing. I usually define a class or global _missing variable object for that. In general, unless you are using a built-in control it's usually better to not specify the ID argument and to supply the missing value for that also. So I'd code that as: button_1 = CType(newToolBar.Controls.Add(1, _missing, _missing, _missing, True), Office.CommandBarButton) Also, when you set the other properties of any button you create make sure to always use a unique Tag property. That prevents the button Click() event from firing as many times as you have open items (Inspectors) or open folder views (Explorers). With a unique Tag the Click() will fire only in that one Inspector or Explorer. -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Matt" wrote in message ... My commandbar was set as temporary but the button was not. Is this way correct: button_1 = CType(newToolBar.Controls.Add(1, 1, Nothing, Nothing, True), Office.CommandBarButton) ? |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
2 questions: date of appt added/who added it? | Melissa | Outlook - Calandaring | 7 | May 15th 09 02:37 PM |
Custom Image added to CommandBar Buttons | Andrew | Add-ins for Outlook | 2 | November 26th 08 02:26 PM |
Outlook2003 added an extra header into my mail ! | Ôq@office | Outlook - Installation | 2 | August 14th 07 07:50 PM |
Outlook2003 added an extra header into my mail ! | Ôq@office | Outlook - General Queries | 1 | August 14th 07 03:12 AM |
Can't see picture added to signature in new mail | CorrinHaupt | Outlook Express | 3 | October 11th 06 09:32 PM |