Macros - Handling different Languages

S

ST

Hi,

I've written macros in English, but the environment they being used, some
clients are in French therefore they do not work because the time formats and
the field names are different.

Are their any utilities that can help port macros to some other language?
Or, is there a good practice for writing macros to identify the language the
client is using and executing the macros accordingly?

Thanks in advance,
SpiroT.
Montreal Quebec.
 
J

Jack Dahlgren

I'm not aware of any public tools for localization of VBA for Project. A
number of the properties have ID's as well as names and these should remain
constant, so you might try using them. I haven't got much more experience
with localization to help with though

-Jack Dahlgren
 
S

ST

Hi Jack,

Do fields such as Duration10 and Flag10 have such IDs?

If so, where would I find them? If not, I will be forced to find and use
the French equivalent for such fields.

/SpiroT.
 
J

Jack Dahlgren

Yes, they have id's.
You can find the id by using the fieldnametofieldconstant method

for example to find the id of duration10 task field you would use
fieldnametofieldconstant("Duration10", pjTask) to determine that the
constant for duration10 is 188743961

Resource fields would be of type pjResource and Project level is pjProject

Typically this is used as a parameter to the getfield or setfield methods:

Sub duration10field()
'this sets duration10 for the first task in the project
'to 5 days
Dim t As Task
Set t = ActiveProject.Tasks(1)
t.SetField FieldID:="188743961", Value:="5"
End Sub

-Jack Dahlgren
 
S

ST

thanks Jack!

Jack Dahlgren said:
Yes, they have id's.
You can find the id by using the fieldnametofieldconstant method

for example to find the id of duration10 task field you would use
fieldnametofieldconstant("Duration10", pjTask) to determine that the
constant for duration10 is 188743961

Resource fields would be of type pjResource and Project level is pjProject

Typically this is used as a parameter to the getfield or setfield methods:

Sub duration10field()
'this sets duration10 for the first task in the project
'to 5 days
Dim t As Task
Set t = ActiveProject.Tasks(1)
t.SetField FieldID:="188743961", Value:="5"
End Sub

-Jack Dahlgren
 
S

ST

Hi Jack,

Would you know the syntax to SetField instead of GetField?

I'm getting "Type Mismatch" debug error with with the following statement:

If (tsk.GetField(FieldID:="188743772") = False) Then ...


/Spiro
 
S

ST

Nevermind, I found it...

If ((tsk.GetField(FieldID:=188743772) = "No") Or ...


Thanks anyhow,
/SpiroT.
 

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