[RESOLVED] .Picture property for CommandBarButton: Automation Error?
Hey, i'm trying to load a custom icon for from a .res file and place it on a command bar button. I found some really straight example code, but for some reason it errors.
here is the example code:
http://msdn.microsoft.com/library/de...HV03083192.asp
Here is my code
VB Code:
'cBarBtn is a CommandBarButton
'cbrCmdBar is my CommandBar
Set cBarBtn = cbrCmdBar.Controls.Add(msoControlButton)
Dim pic As IPictureDisp
Set pic = LoadResPicture("ICON1", vbResBitmap)
cBarBtn.Picture = pic 'this line errors
when i put a watch on cBarBtn, both the .Picture properties and .Mask properties are listed as <Automation Error>
I don't know what i need to to do fix it, i'm lost, any help would be great
thanks
Re: .Picture property for CommandBarButton: Automation Error?
Have you installed the latest SP for Outlook? I only have seen it work in Outlooks VBA class file.
What version of Outlook are you running?
Re: .Picture property for CommandBarButton: Automation Error?
I actually am working in Visio and VB6...and I found the solution, it's interesting. Apparently the .Picture and .Mask properties throw errors if encountered during Debug mode...i compiled my dll and ran, and it worked like a charm
weird
Re: .Picture property for CommandBarButton: Automation Error?
Re: [RESOLVED] .Picture property for CommandBarButton: Automation Error?
Re: [RESOLVED] .Picture property for CommandBarButton: Automation Error?
I got a new system a few months ago at work and I didnt get Visio 2003 serial number from the admin so I installed 2002 because
I needed right away. Maybe I will be able to upgrade it before the end of the year if they ever give me the SN for 2003. :(
Does it work well or is it flakey?
Re: [RESOLVED] .Picture property for CommandBarButton: Automation Error?
I like it a lot! Any flakieness can probably be blamed on the fact that i'm writing for it in VB6 and not .Net (this is not by choice, believe me). I run into problems sometimes because clients are running in 2002. Ii've begun to dislike 2002 just because it is older, so i always have to test for it.
for the most part its not significantly different from 2002, though
Re: [RESOLVED] .Picture property for CommandBarButton: Automation Error?
Thanks. I just dont like not having all my Office apps on the same version. :(
Everything except for Visio. Maybe I will bug them again. :D