Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VB6 : Accessing Toolbars of MS Office on Windows Brazilian version.

Status
Not open for further replies.

Arainxius

Technical User
Sep 11, 2003
16
0
0
CA
I have a COM ADD-in to the MS Outlook 2003 and it needs to run on Windows XP English and Brazilian version. It works fine on English version but not on Brazilian.

Following is the code.

' m_OutlookCmdBars is declared and initializes as

1. Dim m_toolbar As Office.CommandBar
2. Set m_toolbar = m_OutlookCmdBars("Standard")

The code at line# 2 works fine in Windows XP English version.
But it doesn't work on Windows XP running Portugese/Brazilian version.
It throws the following error
Invalid Procedure call or argument.

Any help ?

TIA



 
I just guess it's named other then "Standard" in Brasilian version. You just have to find out how.
:) I tried record a macro in Excel closing Standard toolbar. It named "Standard" on me, but then changing name I got the same error like you).
Probably there is predefined constant (integer) instead of string name?
(Also I found that command bar has Name and NameLocal, NameLocal being different (Russian one for me). But naming by NameLocal just won't work for me)

I guess you can trick with recording macro in Outlook too - I tried but probably I haven't got enough rights
 
Office 2003. not sure of previous versions.

The local name of a built-in command bar is displayed in the title bar (when the command bar isn't docked) and in the list of available command bars— wherever that list is displayed in the container application.

For a built-in command bar, the Name property returns the command bar's U.S. English name. Use the NameLocal property to return the localized name.

If you change the value of the LocalName property for a custom command bar, the value of Name changes as well, and vice versa.

You may need to loop through the command bars collection and identify which one is the command you need by looking at the name and only then set your command object to the correct item on the collection.


Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thanks for your help.

"For a built-in command bar, the Name property returns the command bar's U.S. English name. Use the NameLocal property to return the localized name"

If the desktop is running Windows Portugese multilanguage version then will the ".Name" property still return the US. English name for the built in command bar ??

The problem is I can not verfity it as on the development machine doesn't have the Portugese Windows version.

thanks


 
I have now tried with Excel 2000 Portuguese version on a Portuguese Windows XP.

.name returns the english name (as per my quote)
.namelocal returns the Portuguese name

So a loop is the way to go.

Regards

Frederico Fonseca
SysSoft Integrated Ltd
 
Thank you so much Frederico:

I can loop in and find out the particular CommandBar.
There is another issue for example
On the Menu bar the fifth item is "Tools" and first is "File".
Now I want to add a button to the Tools
Tools is of type Office.CommandBarPopup

In English XP version I am accessing it as

Set IENCmdBarPopup = m_OutlookMenuBar.Controls.Item("Tools")

and then adding the button to it as

Set btnConfigureiExtensions = IENCmdBarPopup.Controls.Add(Type:=msoControlButton, Temporary:=True)

But this won't work on Portugese Windows.
I can also not hardcode it as
Set IENCmdBarPopup = m_OutlookMenuBar.Controls.Item(5)
As We dont' know if the user has changed the order of controls on the Menu Bar then in that case it will add the button at incorrect place.

Any suggestion.

thanks so much

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top