Listing All Outlook 2002 Shortcuts using Outlookbargroups, Outlookbarshortcuts

M

marcbert

I have an issue:

I need to export all Outlook 2002 Shortcuts to a file. I have a piece
of code that will loop through all the shortcuts, and display them on
the screen.

When I get to some user defined shortcuts, which lead to local
locations ("C:\", "m:\documents", etc), it seems like the TARGET
property doesn't contain valid data. When I try to print to the
screen, I get an error.

So I decided to see what type the property is returning. When I do a
typename(objShortcut.Target), for all of the built-in shortcuts, a
type of "MAPIFolder" is returned, which is expected. A URL shortcut
will return type "String" which is fine. A shortcut the points to a
local location ("C:\") returns type "Object". I can't find any
information regarding what properties this "Object" supports. The
goal is, I need the program to return the path ("C:\") of this
object.... Source code is below.......


Sub ShowMyFolders()
On Error Resume Next
Dim objApp As Application
Dim objOB As OutlookBarPane
Dim objOBGroup As OutlookBarGroup
Dim objOBGroups As OutlookBarGroups
Dim objShortcut As OutlookBarShortcut
Dim colShortcuts As OutlookBarShortcuts
Dim objExpl As Explorer

Set objApp = CreateObject("Outlook.Application")
Set objOB = objApp.ActiveExplorer.Panes.Item("OutlookBar")

Set objOBGroups = objOB.Contents.Groups


MsgBox objOBGroups.Count
For Each objOBGroup In objOBGroups
MsgBox "**** " & objOBGroup.Name & " ****"
Set colShortcuts = objOBGroup.Shortcuts
For Each objShortcut In colShortcuts
MsgBox TypeName(objShortcut.Target)
If UCase(TypeName(objShortcut.Target)) = "OBJECT" Then
MsgBox "Name " & objShortcut.Name & vbCrLf & "Class " &
objShortcut.Class & vbCrLf & "Parent " & objShortcut.Parent & vbCrLf &
"Application " & objShortcut.Application & vbCrLf & "Session " &
objShortcut.Session
Else
MsgBox "Name " & objShortcut.Name & vbCrLf &
"Application " & objShortcut.Application & vbCrLf & "Class " &
objShortcut.Class & vbCrLf & "Parent " & objShortcut.Parent & vbCrLf &
"Session " & objShortcut.Session & vbCrLf & "Target " &
objShortcut.Target
End If
Next
Next

' release objects
Set objExpl = Nothing
Set objShortcut = Nothing
Set colShortcuts = Nothing
Set objOB = Nothing
Set objApp = Nothing
End Sub
 
S

Sue Mosher [MVP-Outlook]

I don't think there's any way to extract information from shortcuts that are
not MAPI or String. You're in undocumented territory there.
 
M

Marc

Thank you for your reply Sue!

(I bought your Outlook Programming Book! Good stuff!)

Is there any way to enumerate which properties are
available to the "OBJECT" that is returned?

If there isn't, maybe I should tell you what my ultimate
goal is, and maybe there's a different way I can
accomplish this.

I basically need to extract all user's OutlookBar
Shortcuts, in preparation for the move to Office 2003,
which does not have the OutlookBar any longer. What are
other people doing to make sure these are not lost?

My ultimate goal is to add it to the XML file for
shortcuts in Outlook 2003.....is there an easier way to
extract the data?

Thanks again!

Marc
 
S

Sue Mosher [MVP-Outlook]

AFAIK, no, but if you have a variable assigned to that obect, you might
check the Locals window to see if it exposes any properties.

I'm not sure this whole project is necessary: A user's Outlook 2002 Outlook
Bar migrates to the Shortcuts navigation pane in Outlook 2003. The shortcuts
aren't lost. I suspect, though, that the "object" shortcuts may be
unsupported anyway, since Outlook 2003 does not display system folders as
Outlook 2002 did.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
G

Guest

There is a way within Outlook 2003 to have shortcuts to
local folders......Click the Shortcuts icon, and drag and
drop local folders to the Shortcuts field.

Outlook 2003 does not automatically bring these shortcuts
over from Outlook 2002, however.

Shortcuts, even local drive mappings, are stored in the
Outlook.XML file (or whatever you decide it should be
called).

Thanks for the suggestion for the LOCALS windows. There
seem to be no properties defined for the .target property
that is returned as an OBJECT. I can't find the path
anywhere else......I may need to find a different way....

Thanks Sue
 

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