About language

R

Raquel

Hello,

I am very new in VBA for MS Project and I am very lost. :-((
Let me share my problem with you:

I need to check if a task has a Calendar associated.
What I am doing is:

For Each t In ActiveProject.Tasks

If t.Calendar <> "None" Then
.......
End If

but this only works with English installations and I need a multilingual
tool, so...

My next step was try to translate the "None" to the user language. But I
need the Project installation language (not the PC one...)

I have this already done in excel:

Public Sub TranslateConstantToLocalLanguage()
Dim lang As String
lang = Application.International(xlCountryCode)

If lang = 49 Then
cNone = "Ohne" ' German
ElseIf lang = 34 Then
cNone = "Ninguno" ' Spanish
Else: cNone = "None" ' default English
End If

End Sub

but in MS Project Application object has no International method. :-((

So, my question is:
Does anybody know the name constant where None value is stored for doing

If t.Calendar <> pjNoneValue Then...

If not, does anybody know how to get the MS Project language installation?

Any clue will be appreciated.

Thanks in advance,

Raquel
 
J

Jack Dahlgren MVP

Hmmm...
One way to determine what it is would be to create a new task with no
calendar, read the calendar for that task, then compare against it. Then you
could delete the new task.
Following this you could build your own lookup table.

-Jack Dahlgren
 

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