Outlook 2003 changes to Outlook bar

M

murdo

Hi

I have the following script that adds a shortcut to the companies
phone directory to the "Outlook bar". This works with Outlook 2000
and Outlook XP but with Outlook 2003 it fails. It gives me "Object
Required: ol.ActiveExplorer". I have tried to debug the script
(obiously slightly changed so it works within the Visual Studio) but
still cannot see why this is the case because ActiveExplorer object
exists in the Outlook Object browser. I was expecting the error with
"Item("OutlookBar")" as the Outlook Bar has been changed/merged with
the folder list.

' need the Wsh to outlook COM bridge
Set ol = WScript.CreateObject("Outlook.Application")

'Find the Shortcuts collection for the group
Set oPane = ol.ActiveExplorer.Panes.Item("OutlookBar")
Set oGroup = oPane.Contents.Groups.Item("Outlook Shortcuts")
Set oShortcuts = oGroup.Shortcuts

oShortcuts.Add "http://intranet/Telephone_directory.htm", "Phone
Directory"

Set oShortcuts = Nothing
Set oPane = Nothing
Set oGroup = Nothing

Can anyone help me with trying to get/adapt this to work with Outlook
2003 so that the shortcut is added to Outlook 2003 Shortcuts panel. I
have tried the original script i got from a newsgroup but that fails
at the same place.

Thanks

Murdo
 
S

Sue Mosher [MVP-Outlook]

Are you getting a valid ol object? If you are running an anti-virus program
that includes a script blocker, the CreateObject statement won't work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top