Solved

MS Office Command Bar button image Transparency problem

Posted on 2009-07-07
10
580 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
Are your AD admin tools letting you down?

Managing Active Directory can get complicated.  Often, the native tools for managing AD are just not up to the task.  The largest Active Directory installations in the world have relied on one tool to manage their day-to-day administration tasks: Hyena. Start your trial today.

 
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
 
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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
vb6 - Transfer from MSHFlexgrid1 to xls issue 8 51
how to open abcd.txt.orig file? 10 45
Install both Office 2010 and 2013 4 37
Sub or Function is not defined 6 29
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

773 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