|
-
Apr 22nd, 2004, 03:36 AM
#1
Thread Starter
Member
About Outlook Com Add-In..."Resolved"
Hi all,
Is there anybody know how to put your own icon / picture onto the command bar button for outlook com add-in (using VB 6)?
I've created a button and used it's picture property but it didn't work for me....
button1.picture = LoadPicture("xyz.ico")
Please help
Last edited by Siu Yan; May 18th, 2004 at 08:16 AM.
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Apr 22nd, 2004, 10:48 AM
#2
For a menuitem Type of msoControlButton and .Style of
msoControlCustom and control of Office.CommandBarButton
the .Picture property is correct, but it is only supported on
Outlook 2003 (11.5608.5703) and above. If you haven't done an
Office Update from M$ then do that and that will fix the issue.
HTH
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 
-
Apr 22nd, 2004, 11:18 AM
#3
Edit... the .Picture property is available in XP. In Outlook 2003 you
need to update to the latest build because of a bug that will fail
the property.
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 
-
Apr 22nd, 2004, 12:03 PM
#4
Thread Starter
Member
So you meant if I didn't update my outlook 2002 to 2003 or above. I can't use .Picture to show my icon?!
Do you have any other methods that can show an icon / picture on command bar button insteads of using .Picture?
With many thanks
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Apr 22nd, 2004, 03:14 PM
#5
As per my last post, if you have Outlook 2003 it needs to be
updated to the latest build release.
Can you post your code that creates the button?
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 
-
Apr 22nd, 2004, 05:28 PM
#6
I tried creating an AddIn for Outlook to test it out and the .Picture
method fails, but if the code is in Outlook VBA it will succeed.
Strange.
In my addin one way I got around it was to create a form that is
loaded with an image control with the picture already set to what
I want the menu item picture to be. Then after it was loaded I did
a "If Clipboard.GetFormat(vbCFBitmap) Then
cbNewMenuItem.PasteFace" to get the picture there.
HTH
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 
-
Apr 23rd, 2004, 03:27 AM
#7
Thread Starter
Member
VB Code:
Friend Sub InitHandler(olApp As Outlook.Application, strProgID As String)
'Create message details button
Set standardBar = golApp.ActiveExplorer.CommandBars("Standard")
Set btnDetails = standardBar.Controls.Add(msoControlButton, , , , True)
With btnDetails
'Change the button image
'.Picture = LoadPicture("messageDetails.bmp")
.FaceId = 259
.Caption = "Message Details"
.Tag = "Message Details"
.Style = msoButtonIconAndCaption
.Visible = True
.Enabled = False
End With
At here I'm using .FacrID instead of .Picture because if I use .Picture, once the complier reaches .Picture that statment, it will jump to the end and won't go to .Caption, .Tag...etc.
I want to ask if I use your method, will a form show up on screen?
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Apr 23rd, 2004, 03:30 AM
#8
Thread Starter
Member
It's strange....I just made my outlook add-in to .dll file and tried on outlook. The caption was showed on the screen just missed the icon. (I was using .Picture)
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
-
Apr 23rd, 2004, 12:40 PM
#9
You can load the form but dont show it. As long as its loaded into
memory and not visible the image will be reference-able. The only
thing I found was that .Picture only works in the VBA of Outlook
and not in an addin. The .FaceId will work, but you can only use
pictures from Outlook menus or toolbars and not any custom
images. The .PasteFace method seems to work but you can not
assign a mask for the pasted image.
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 
-
Apr 27th, 2004, 12:02 PM
#10
Thread Starter
Member
About Outlook Com Add-In ...."[Resolved]"
Thanks.
Now, I'm using your way to get my own icon.
Quitters never Win, Winners never Quit, But those who Never Win and Never Quit are Idiots 
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
|