Solved

MS Office Command Bar button image Transparency problem

Posted on 2009-07-07
10
576 Views
Last Modified: 2013-11-18

I am trying to make a pretty bmp for my MS Office commandbar button.  The command bar is being added by an Outlook 2003 add-in .dll.  I am making the .dll in VB6 as a COM Add-in.

I have no idea why a picture added to a commandbar must be so difficult. In any case I made my own little 16x16 and cut and copied the code from here http://support.microsoft.com/kb/288771

I even used the same color.
On my computer and my work computer this red color is made transparent, then wouldn't you believe it i gave it to someelse and the dam transparency does not work.

It turns out that if I change MS Office language to German that the transparency does not work.....how can a language change effect this.

I found that Microsoft Germany has the same code in german
http://support.microsoft.com/kb/288771/de Your browser might automatically at first go to an english version. But the code is the same

Does anyone have any help?


I have added the part of the .dll that adds the commandbar and picture to the bar.
0
Comment
Question by:darbid73
  • 5
  • 5
10 Comments
 
LVL 20

Assisted Solution

by:alainbryden
alainbryden earned 200 total points
ID: 24795874
Is red the default transparent colour? You could be getting the problem because you've set to transparent colour for the toolbar to the Environment Default instead of to 'Red' explicitly. If this is the case, when the environment changes, the default transparent colour might change too, ruining your transparency.

--
Alain
0
 
LVL 19

Author Comment

by:darbid73
ID: 24795914
Wow I have never heard of a default Environment transparency.  How do I find out what it is?

In any case if you can "Trust" microsoft their suggested code in Germany and English uses the same color which is &HFF00FF
 or Magenta (RGB(255, 0, 255))
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 24796028
Well if you explicitly used the colour definition in the mask (CopyBitmapAsButtonFace oPic, &HFF00FF
) then that probably isn't a problem. I was referring to how some colours are set to the System.Window colour, or System.ControlText. I was wondering whether you hadn't used a System.Mask colour property or something - but evidently you haven't. It was my only real idea :(

If your friend changes their MS Office language to english does it work? It could be that one of those many new functions you had to add refer to a LIB that is different for the German language pack?

--
Alain
0
 
LVL 19

Author Comment

by:darbid73
ID: 24796083
I can reproduce the problem on my computer. ie. if Office is in English it makes the color transparent if I change my Office to German it shows the red.

My problem is that VB6 is not on a multilingual computer so I cannot debug all those functions.

So the LIBs are there, there is something in the language. :-(
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 24796217
Phew :/ Multi-language support is a challenging task that I have never undertaken... Good luck with this bro.
--
Alain
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 19

Author Comment

by:darbid73
ID: 24798286
I have decided to install VB6 on a box that speak both languages - but if i may ask a dumb question - how do I debug this in VB6 it is an Add-in so can I step through it or do I have to print some output to a file?
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 24804057
I'm not sure, I've never debugged a VB6 add-on, but Visual Studio 2008 can probably do it.

--
Alain
0
 
LVL 19

Author Comment

by:darbid73
ID: 24811918
Well alainbryden I am not sure this question is going to go any further.  I have asked a new question based on a totally different method http://www.experts-exchange.com/Programming/Languages/Visual_Basic/Q_24555748.html at least I can reliably get it NOT working irrespective of the language.

I am not sure we can take this question any further, and I am also not sure that I can say that it is answered either.  I would like to allocate some "Thank you for comforting me point" but It seems points only go with "this is a solution".  Would you have a problem with me closing this question without an answer?
0
 
LVL 20

Expert Comment

by:alainbryden
ID: 24815198
No, that would be fine.

Good luck with the new method!

--
Alain
0
 
LVL 19

Accepted Solution

by:
darbid73 earned 0 total points
ID: 24815457
Actually to round of this thread and the third and final method WHICH WORKED for me I used this tutorial here. http://www.vbforums.com/showthread.php?t=402044  It basically means that you use a mask.  I did not have to use flash graphical programs and it works in all languages.

I also learnt how to pack my files as resources into my VB6 COM Add-in so I am pretty impressed with myself.


0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Using Word 2013, I was experiencing some incredible lag when typing.  Here's what worked for me....
This video walks the viewer through the process of creating envelopes and labels, with multiple names and addresses. Navigate to the “Start Mail Merge” button in the Mailings tab: Follow the step-by-step process until asked to find the address doc…
The viewer will learn how to simulate a series of sales calls dependent on a single skill level and learn how to simulate a series of sales calls dependent on two skill levels. Simulating Independent Sales Calls: Enter .75 into cell C2 – “skill leve…

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now