![]() |
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
|
|||
|
|||
![]()
Hi all,
due to some faulty programming my C++ COMAddIn does not delete the custom toolbar it has created. I am attempting to write a vbscript which will allow the administrator to cleanup this toolbar without having to install a macro/ComAddin or anything of the sort. Is this possible in vbscript? Can someone point me in the direction of the OOM objects which are available in vbscript as opposed to VBA? A small snippet of how I think the removal of the toolbar should work is posted below. -------------------------------------------------------------------------------- Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") objNamespace.Logon "Outlook", , FALSE, TRUE Set myOlExp = objOutlook.ActiveExplorer Set myCmdBars = myOlExp.CommandBars mycbars.delete("My toolbar") Wscript.Echo "done" objOutlook.Quit |
#2
|
|||
|
|||
![]()
Something like that should work, although I'd change the NameSpace.Logon to
objNameSpace.Logon "", "", False, True or even use False for the NewSession argument. Of course the real solution is to create the toolbar using the Temporary = true argument and to explicitly delete it in the Explorer.Close() event handler. -- 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 "movalgirl" wrote in message ... Hi all, due to some faulty programming my C++ COMAddIn does not delete the custom toolbar it has created. I am attempting to write a vbscript which will allow the administrator to cleanup this toolbar without having to install a macro/ComAddin or anything of the sort. Is this possible in vbscript? Can someone point me in the direction of the OOM objects which are available in vbscript as opposed to VBA? A small snippet of how I think the removal of the toolbar should work is posted below. -------------------------------------------------------------------------------- Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") objNamespace.Logon "Outlook", , FALSE, TRUE Set myOlExp = objOutlook.ActiveExplorer Set myCmdBars = myOlExp.CommandBars mycbars.delete("My toolbar") Wscript.Echo "done" objOutlook.Quit |
#3
|
|||
|
|||
![]()
Thanks for the tip. Unfortunately, it is legacy code which creates
this permanent toolbar - new versions only create the toolbar as a "temporary" toolbar. I have to work out some way to automatically delete this permanent toolbar during an upgrade of our software. I am now using the following vbscript to delete the permanent toolbar. The toolbar is deleted in the current outlook session but at the next Outlook startup - there it is again. Worse than the plague :-) ----------------------------------------------------------------- Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") objNamespace.Logon "","", FALSE, TRUE Set oCBars = objOutlook.ActiveExplorer.CommandBars For i = oCBars.Count To 1 Step -1 Wscript.Echo oCBars.Item(i).Name If oCBars.Item(i).Name = "IXOSOST" Then oCBars.Item(i).Delete End If Next Wscript.Echo "done" objOutlook.Quit ------------------------------------------------------------------------ p.s. i cannot simply delete the extend.dat file as the customer has numerous other addIns and not much of a sense of humour... Thanks in advance, movalgirl ------------------------------------------------ On Mar 20, 2:16*pm, movalgirl wrote: Hi all, due to some faulty programming my C++ COMAddIn does not delete the custom toolbar it has created. I am attempting to write a vbscript which will allow the administrator to cleanup this toolbar without having to install a macro/ComAddin or anything of the sort. Is this possible in vbscript? Can someone point me in the direction of the OOM objects which are available in vbscript as opposed to VBA? A small snippet of how I think the removal of the toolbar should work is posted below. ---------------------------------------------------------------------------*----- Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") objNamespace.Logon "Outlook", , FALSE, TRUE Set myOlExp = objOutlook.ActiveExplorer Set myCmdBars = myOlExp.CommandBars mycbars.delete("My toolbar") Wscript.Echo "done" objOutlook.Quit |
#4
|
|||
|
|||
![]()
Extend.dat has nothing to do with addins or toolbars, it's where ECE's are
set (Exchange extensions written in C++ or Delphi using Extended MAPI). The toolbar/menu customizations are held in a file outcmd.dat, which is also reconstructed when Outlook starts if it's not there. However, given that code as soon as that addin runs again the toolbar will be back and deleting it with an outside script or by deleting outcmd.dat are your main options. Of course depending on how the addin is written, if it doesn't check for at least one Explorer when Outlook starts then your script will start Outlook and the addin and the toolbar will be created then again. -- 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 "movalgirl" wrote in message ... Thanks for the tip. Unfortunately, it is legacy code which creates this permanent toolbar - new versions only create the toolbar as a "temporary" toolbar. I have to work out some way to automatically delete this permanent toolbar during an upgrade of our software. I am now using the following vbscript to delete the permanent toolbar. The toolbar is deleted in the current outlook session but at the next Outlook startup - there it is again. Worse than the plague :-) ----------------------------------------------------------------- Set objOutlook = CreateObject("Outlook.Application") Set objNamespace = objOutlook.GetNamespace("MAPI") objNamespace.Logon "","", FALSE, TRUE Set oCBars = objOutlook.ActiveExplorer.CommandBars For i = oCBars.Count To 1 Step -1 Wscript.Echo oCBars.Item(i).Name If oCBars.Item(i).Name = "IXOSOST" Then oCBars.Item(i).Delete End If Next Wscript.Echo "done" objOutlook.Quit ------------------------------------------------------------------------ p.s. i cannot simply delete the extend.dat file as the customer has numerous other addIns and not much of a sense of humour... Thanks in advance, movalgirl |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Could not save custom toolbars in Outlook 2000 | allenh | Outlook - Installation | 1 | October 25th 07 05:17 PM |
Saving Custom Toolbars | [email protected] | Outlook - General Queries | 0 | October 16th 07 11:50 AM |
How to add a button to a custom form with vbscript | Robert Lindermeier - Your-Admin eK | Outlook - Using Forms | 3 | February 26th 07 04:02 PM |
VBScript to remove Outlook signatures | Joseph Carew | Outlook - General Queries | 3 | September 19th 06 09:19 AM |
VBScript to remove Outlook signatures | Brian Tillman | Outlook and VBA | 0 | September 18th 06 01:38 PM |