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.

Signature
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
> Hi all,
>
[quoted text clipped - 24 lines]
> Wscript.Echo "done"
> objOutlook.Quit
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
------------------------------------------------
> Hi all,
>
[quoted text clipped - 24 lines]
> Wscript.Echo "done"
> objOutlook.Quit
Ken Slovak - [MVP - Outlook] - 25 Mar 2008 14:46 GMT
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.

Signature
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
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