List of Categories in Outlook 2010

E

emdeegeebee

Is there any way of getting a printable list of categories assigned in
Microsoft Outlook 2010?

e.g. to allow the list to be fine-tuned and or for colleagues to also
have the same categories available

TIA!
 
G

Graham Mayor

The following macro in Outlook should work to produce a list of categories
in a Word document.
Set a reference to the Microsoft Word object library in the vba editor
(Tools > References).
Although aimed at Word the principles shown at
http://www.gmayor.com/installing_macro.htm apply to Outlook also should you
not know what to do with macro listings.

Sub MyCategories()
Dim oCat As Category
Dim sList As String
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim bStarted As Boolean
sList = ""
For Each oCat In Session.Categories
sList = oCat & vbCr & sList
Next oCat
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err Then
Set wdApp = CreateObject("Word.Application")
bStarted = True
End If
Set wdDoc = wdApp.Documents.Add
wdApp.Visible = True
wdApp.Activate
wdDoc.Range = sList
Set wdDoc = Nothing
Set wdApp = Nothing
Set oCat = Nothing
End Sub
 
J

Joe

The following macro in Outlook should work to produce a list of categories
in a Word document.
Set a reference to the Microsoft Word object library in the vba editor
(Tools > References).
Although aimed at Word the principles shown athttp://www.gmayor.com/installing_macro.htmapply to Outlook also should you
not know what to do with macro listings.

Sub MyCategories()
Dim oCat As Category
Dim sList As String
Dim wdApp As Word.Application
Dim wdDoc As Word.Document
Dim bStarted As Boolean
sList = ""
For Each oCat In Session.Categories
    sList = oCat & vbCr & sList
Next oCat
On Error Resume Next
Set wdApp = GetObject(, "Word.Application")
If Err Then
    Set wdApp = CreateObject("Word.Application")
    bStarted = True
End If
Set wdDoc = wdApp.Documents.Add
wdApp.Visible = True
wdApp.Activate
wdDoc.Range = sList
Set wdDoc = Nothing
Set wdApp = Nothing
Set oCat = Nothing
End Sub

This is perfect... thanks.
Please note: In Outlook 2010 I had to set
[Developer][Macro Security][Macro Settings]=Notification for all
macros.
Then I had to stop and restart Outlook... and allow macros from the
security warning dialog that appeared when I restarted Outlook.
Also, as Graham noted, make sure you do the following from the VB for
Apps editor:
[Tools][References][Microsoft Word 14.0 Object Library] = checked

Thanks
-- Joe
 

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