|
-
Jul 6th, 2005, 11:02 AM
#1
Thread Starter
Member
[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
-
Jul 7th, 2005, 12:43 AM
#2
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 11th, 2005, 12:23 PM
#3
Thread Starter
Member
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
-
Jul 11th, 2005, 12:23 PM
#4
Re: .Picture property for CommandBarButton: Automation Error?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 11th, 2005, 12:25 PM
#5
Thread Starter
Member
Re: [RESOLVED] .Picture property for CommandBarButton: Automation Error?
-
Jul 11th, 2005, 12:29 PM
#6
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?
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jul 11th, 2005, 12:39 PM
#7
Thread Starter
Member
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
-
Jul 11th, 2005, 12:50 PM
#8
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.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
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
|
Click Here to Expand Forum to Full Width
|