D
David
Hi,
I try To add an Icon(custom icon) to a commandBarButton.
I wrote the foloeing code in vba:
Dim myOlApp As New Outlook.Application
Dim objInsp As Outlook.Inspector
Dim objCBB As Office.CommandBarButton
Dim objCB As Office.CommandBar
Set myOlApp = CreateObject("Outlook.Application")
Set objInsp = myOlApp.ActiveInspector
Set objCB = objInsp.CommandBars("standard")
Set objCBB = objCB.Controls.Add(Type:=msoControlButton)
With objCBB
.Style = msoButtonIconAndCaption
.Caption = "MyAction"
.Visible = True
.Picture = stdole.LoadPicture("C:\Documents and Settings\MrkvLogo.ico")
.Mask = stdole.LoadPicture("C:\Documents and Settings\MrkvMask.ico")
End With
I get this error in ".Picture=..." and ".Mask=..." rows
Error message:
Run time error '5' :
Invalid procedure call or argument.
I use outlook 2003. However I need this code to work also with outlook 2000.
Thanks,
David
I try To add an Icon(custom icon) to a commandBarButton.
I wrote the foloeing code in vba:
Dim myOlApp As New Outlook.Application
Dim objInsp As Outlook.Inspector
Dim objCBB As Office.CommandBarButton
Dim objCB As Office.CommandBar
Set myOlApp = CreateObject("Outlook.Application")
Set objInsp = myOlApp.ActiveInspector
Set objCB = objInsp.CommandBars("standard")
Set objCBB = objCB.Controls.Add(Type:=msoControlButton)
With objCBB
.Style = msoButtonIconAndCaption
.Caption = "MyAction"
.Visible = True
.Picture = stdole.LoadPicture("C:\Documents and Settings\MrkvLogo.ico")
.Mask = stdole.LoadPicture("C:\Documents and Settings\MrkvMask.ico")
End With
I get this error in ".Picture=..." and ".Mask=..." rows
Error message:
Run time error '5' :
Invalid procedure call or argument.
I use outlook 2003. However I need this code to work also with outlook 2000.
Thanks,
David