Coding MS Project 2003 VBA for multiple Languages?

J

john.talbot

I have been coding some macros to run in MS Project 2003 that works
fine when run under English language version but when used by a user in
say France using the French MUI option fails miserably.

I have a work around for:

ViewApply Name:="Resource Table", singlepane:=True

By seraching for a view with right screen attribute eg

' Get first resource table view
For Each viewObject In myproj.ViewsSingle
If viewObject.Screen = pjResourceSheet Then
ResViewName = viewObject.Name
Debug.Print "ResTab", ResViewName
Exit For
End If
Next viewObject

ViewApply Name:=ResViewName, singlepane:=True

But now have run into the problem of:

projapp.SelectTaskField Row:=1, Column:="Unique ID"


which crashes with Invalid attribute when in French etc

I have found that each field has a "UniqueID" value that has a
corresponding Symbolic constant in VBA eg
For Task Usage view:
Filed aclled "ID" is 188743703 = pjTaskID
etc

But there does not seem to be a way of translating the number to the
current Name requied in


Does any one have a either
a) a way of selecting the filed by this UID or

b)a table that lists all the built in fields (visible and Hidden) for
the Resource Table and the Task Uasge table for other languages so that
I can do something like:

Lang_Name = Application.LanguageSettings.LanguageID( msoLanguageIDUI )

Vlookup( etc)

to get the field name for current language.

I have tried 6 search engines and several Groups but have drawn blank
so far.


Seems to be a deficiency in MS Project VBA design to me will it improve
in 2007 version?.
 
R

Rod Gill

Have you tried the FieldConstantToFieldName function and the
FieldNameToFieldConstant functions? Use them with the Getfield method.
 
J

john.talbot

Brilliant Rob,
That is eaxctly what I need.
Now why could I not find that with Help etc?
Just did not ask the right question I suppose.

Gratefully
jt
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top