xld
Banned
- Joined
- Feb 8, 2003
- Messages
- 5,378
Want a list of the application constants?
First set a reference to the Typelib dll. You will need to browse for it, it won't be automatically loaded, On my machine it is called TLBINF32.DLL.
Then run this code. It is set for Outlook XP, you might need to check the Outlook OLB file, it might have a version prefix for 2000, or 2003.
Of course, the Outlook OLB could be substituted by any of the other application OLBs.
First set a reference to the Typelib dll. You will need to browse for it, it won't be automatically loaded, On my machine it is called TLBINF32.DLL.
Then run this code. It is set for Outlook XP, you might need to check the Outlook OLB file, it might have a version prefix for 2000, or 2003.
Code:
Public Sub GetConstants()
Dim oOLB As Object
Dim sText As String
Dim oOLBc, oOLBm
Dim j As Integer
On Error Resume Next
With Worksheets("Constants")
With .Range("A1")
.Offset(0, 1).Value = "Outlook"
.Offset(1, 1).Value = "msoutl.olb"
.Cells(3, 1).Resize(.CurrentRegion.Rows.Count, 2).ClearContents
Set oOLB = TypeLibInfoFromFile(Application.path & "\msoutl.olb")
j = 2
For Each oOLBc In oOLB.Constants
For Each oOLBm In oOLBc.Members
.Offset(j, 0).Value = oOLBm.Name
.Offset(j, 1).Value = oOLBm.Value
j = j + 1
Next oOLBm
Next oOLBc
End With
.Visible = True
.Activate
.Range("A1").Select
End With
Set oOLB = Nothing
End Sub
Of course, the Outlook OLB could be substituted by any of the other application OLBs.