Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Outlook OnAction question

Status
Not open for further replies.

jasonphillipstx

Technical User
Dec 10, 2001
43
0
0
US
I get an error when running the following code in outlook 2003. When I comment out the .OnAction line all works as intended. With it in, I get runtime error 438. object doesn;t support this property or method. Can someone help me with this one?

Code:
Public Sub EnumButtons()
Dim i As Integer
Dim cnt As Integer
Set olapp = Outlook.Application.ActiveExplorer
Set objcb = olapp.CommandBars("Standard")
Set objbut = objcb.Controls
cnt = objbut.Count
Debug.Print cnt
i = 1
Dim fso As FileSystemObject
Set fso = New FileSystemObject
Dim f1
Set f1 = fso.CreateTextFile("c:\buttons.txt", True)
Do While i <= cnt
    With objbut(i)
        f1.Write i & " - " & .Caption
        f1.WriteBlankLines (1)
        f1.Write "     OnAction = "  & .OnAction ' <-----this is the line that gives me the error
        f1.WriteBlankLines (1)
        f1.Write "     Parameter = " & .Parameter
        f1.WriteBlankLines (2)
        End With
        i = i + 1
Loop
f1.Close

Set olapp = Nothing

'open txt file
Set sh = CreateObject("WScript.Shell")
sh.Run "c:\buttons.txt"
End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top