Wouldn't that cause the button to be deleted every time the window is closed? What would cause it to get recreated, other than closing and reopening Outlook?
Printable View
Wouldn't that cause the button to be deleted every time the window is closed? What would cause it to get recreated, other than closing and reopening Outlook?
But I need for the button to be permanent. I only want it deleted if the COM add-in is removed.
It usually is best to make it permenant if your adding to the main window/explorer. In the Inspecotor window, you only need to add it when the Inspector is created. Since your giving the user the ability to remove the addin, its too much trouble to remove the button. Its easier to only add it to the Inspector upon the need.
Do you mean that the button would get created every time the user opened a window to read a message?
Yes and what is you work around code for adding it?
I have to admit that my work around is pretty clumsy. I've created two programs. One has to be run on the client workstation by an administrator. It registers the COM add-in globally. The other has to be run by the user. It adds the peices to HKCurrentUser. The add-in is programmed to run on first load, then only on demand. The first time the user opens Outlook afterward, the add-in creates the CommandBar button.
This is my first experience with a COM add-in. I really didn't know what I was doing. There is a huge lack of documentation for creating a COM add-in with VB. I found books that cover add-in development with VB.NET, C# and C++, but next to nothing for VB. The few books that I've picked up only mention it in passing. Microsoft didn't make it easy.
Nope, they sure didnt as I am not 100% fulent in Addin either. Every program is different in the way you need to write your addin.
If we were creating the Inspector it would be easier but since we are not I think there must be a way to hook the event as I was but wait for it to be completely initialized so we can add to the commandbars.
Ok, I have an idea and have already created a test Add-In. My idea is to create the NewInspector event. Then in that event set a inspector object variable = to the current inspector. Then set that inspector object to the Inspector evetns which contains an Activate event which we could use to identify that the Inspector is completely initialized and available. Then at that point we can gain access to the Inspector commandbars collection and add the menu item. :D
I'lll post back when I get it working. :D