-
You might want to try this.
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.
[vba]
Public Sub GetWordConstants()
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
[/vba]
Of course, the Outlook OLB could be substituted by any of the other application OLBs.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules