[VSTO] Localization for parameter in functions RRS feed

  • Question

  • Hi all,

    i have a question about localization for parameters using in MS Project Professional functions. For example, for creating a view in German MS Project, I use a code line as following

    ViewEditSingle Name:="My new view", Create:=True, Screen:=1, ShowInMenu:=True, HighlightFilter:=False, Table:="Eingabe", Filter:="Alle Vorgänge", Group:="Ohne Gruppe"

    As you can see, for the parameters Table, Filter and Group, I have to use localized name in German. That means my code won't work when I try to apply it for English MS Project file because there is no object with those names (in english version they should be Table: Input, Filter: All tasks, Group: No Group).

    Is it possible to make the code line above working with any language? I see that there is a function FieldConstantToFieldName, where I can give a field constant and have its name back. Is there something equivalent for table/filter/group?


    • Edited by Tri D Nguyen Thursday, November 14, 2013 10:27 AM
    Thursday, November 14, 2013 10:26 AM

All replies

  • There isn't a function for that I'm afraid. A typical solution is to have a text file you use to translate. You can have either the German or English text followed by the other. I would read it into memory at the start of the program and have a function returning specific values as required.

    A separate text file obviously allows updating without changing code.

    Rod Gill

    The one and only Project VBA Book

    Rod Gill Project Management

    Thursday, November 14, 2013 7:22 PM