Results 1 to 10 of 10

Thread: About Outlook Com Add-In..."Resolved"

  1. #1

    Thread Starter
    Member Siu Yan's Avatar
    Join Date
    Apr 2004
    Location
    Hong Kong --> Ireland
    Posts
    49

    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

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  3. #3
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  4. #4

    Thread Starter
    Member Siu Yan's Avatar
    Join Date
    Apr 2004
    Location
    Hong Kong --> Ireland
    Posts
    49
    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

  5. #5
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  7. #7

    Thread Starter
    Member Siu Yan's Avatar
    Join Date
    Apr 2004
    Location
    Hong Kong --> Ireland
    Posts
    49
    VB Code:
    1. Friend Sub InitHandler(olApp As Outlook.Application, strProgID As String)
    2.  
    3. 'Create message details button
    4.     Set standardBar = golApp.ActiveExplorer.CommandBars("Standard")
    5.     Set btnDetails = standardBar.Controls.Add(msoControlButton, , , , True)
    6.    
    7.     With btnDetails
    8.         'Change the button image
    9.         '.Picture = LoadPicture("messageDetails.bmp")
    10.         .FaceId = 259
    11.         .Caption = "Message Details"
    12.         .Tag = "Message Details"
    13.         .Style = msoButtonIconAndCaption
    14.         .Visible = True
    15.         .Enabled = False
    16.     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

  8. #8

    Thread Starter
    Member Siu Yan's Avatar
    Join Date
    Apr 2004
    Location
    Hong Kong --> Ireland
    Posts
    49
    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

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709
    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 PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI 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

  10. #10

    Thread Starter
    Member Siu Yan's Avatar
    Join Date
    Apr 2004
    Location
    Hong Kong --> Ireland
    Posts
    49

    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
  •  



Click Here to Expand Forum to Full Width