View Single Post
Old 07-27-2009, 02:39 AM   #11
Newly Registered User
Join Date: Jun 2008
Location: Munich
Posts: 1,428
Thanks: 6
Thanked 38 Times in 35 Posts
darbid will become famous soon enough
Re: Which image formats to use with ribbon buttons?

Originally Posted by ListO View Post
Am I the only person here having this problem?
ListO have you still got a problem?

How are you currently adding the button?

I have ZERO experience with Access 2007 but have gone through this process with adding my one transparent image in 2003.

I am aware of three methods to add transparent images, but for me only Nr.3 worked properly and I think is the only one of these that you can use with VBA the others would need VB6

Method 1 (in some languages)

Method 2

Method 3
Dim myOCB As Office.CommandBar
Dim myOCBBTools As Office.CommandBarPopup
Dim myPIC As stdole.IPictureDisp
Dim myMASK As stdole.IPictureDisp

Set myPIC = LoadPicture("path to your image")
Set myMASK = LoadPicture("path to your mask image")
Set myOCB = Application.CommandBars("Menu Bar")
Set myOCBBTools = myOCB.Controls("&Tools")

Set myOCBBCustom = myOCBBTools.Controls.Add(msoControlButton, 1, , , True) 

With myOCBBCustom                                                        
    .Caption = "Hello"
    .Enabled = True
    .Picture =  myPIC
    .Mask = myMASK
    .Visible = True
End With

Does this look familiar to you.

To get your masked image open your .bmp image in paint and just make any non-transparent part of the image black.
darbid is offline   Reply With Quote