Outlook VBA Script that gets list of COM (Component Object Model) Addins installed in Outlook

Option Explicit

' VBA Script that gets list of Outlook COM AddIns
' Use Tools->Macro->Security to allow Macros to run, then restart Outlook
' Run Outlook, Press Alt+F11 to open VBA
' Programming by Greg Thatcher, http://www.GregThatcher.com
Public Sub GetListOfComAddIns()
    On Error GoTo On_Error
    
    Dim Report As String
    Dim AddIns As COMAddIns
    Dim AddIn As COMAddIn
    
    Set AddIns = Application.COMAddIns
    For Each AddIn In AddIns
        Report = Report & "Description : " & AddIn.Description & vbCrLf
        Report = Report & "ProgId : " & AddIn.ProgId & vbCrLf
        Report = Report & "Connect : " & AddIn.Connect & vbCrLf
        Report = Report & "Creator : " & AddIn.Creator & vbCrLf
        Report = Report & "Guid : " & AddIn.GUID & vbCrLf
        Report = Report & "Parent : " & AddIn.Parent & vbCrLf
        
        Report = Report & vbCrLf & vbCrLf
    Next AddIn
    
    Call CreateReportAsEmail("List of COM AddIns", Report)
    
Exiting:
        Exit Sub
On_Error:
    MsgBox "error=" & Err.Number & " " & Err.Description
    Resume Exiting
    
End Sub


' VBA SubRoutine which displays a report inside an email
' Programming by Greg Thatcher, http://www.GregThatcher.com
Public Sub CreateReportAsEmail(Title As String, Report As String)
    On Error GoTo On_Error
    
    Dim Session As Outlook.NameSpace
    Dim mail As MailItem
    Dim MyAddress As AddressEntry
    Dim Inbox As Outlook.Folder
    
    Set Session = Application.Session
    Set Inbox = Session.GetDefaultFolder(olFolderInbox)
    Set mail = Inbox.Items.Add("IPM.Mail")
    
    Set MyAddress = Session.CurrentUser.AddressEntry
    mail.Recipients.Add (MyAddress.Address)
    mail.Recipients.ResolveAll
    
    mail.Subject = Title
    mail.Body = Report
    
    mail.Save
    mail.Display
    
    
Exiting:
        Set Session = Nothing
        Exit Sub
On_Error:
    MsgBox "error=" & Err.Number & " " & Err.Description
    Resume Exiting

End Sub




Problems, Comments, Suggestions? Click here to contact Greg Thatcher
Please read my Disclaimer





Copyright (c) 2013 Thatcher Development Software, LLC. All rights reserved. No claim to original U.S. Gov't works.