From: Richard Moore on
Hi,

I'm trying to create a script to permanently delete a toolbar from Outlook
and have come across the following from
http://www.pcreview.co.uk/forums/thread-3456107.php

The first script displays the error:

Line 6, Char 1, Error: Object required: 'myOlExp', Code: 800A01A8

[code]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[/code]


The second script displays the error:

Line 6, Char 1, Error: Object required: 'objOutlook.ActiveExplorer', Code:
800A01A8

[code]

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

[/code]



Any help would be great!


Thanks,

Richard

 | 
Pages: 1
Prev: general.vista
Next: Outlook Toolbar Script