Open Word Doc / Inch vs CM

  • 1. (Before I code my own) is there any function to open a Word Document (e.g. using automation)?

    2. Does anyone have a good method to "guess" whether to default to Inches or CM? I'm thinking of using Inches if the Locale is USA, otherwise CM...

    • Offizieller Beitrag
    Code
    1. (Before I code my own) is there any function to open a Word Document (e.g. using automation)?

    No guarantee with this:

    Zitat

    2. Does anyone have a good method to "guess" whether to default to Inches or CM? I'm thinking of using Inches if the Locale is USA, otherwise CM...

    Check out GetLocaleFormatSettings in SysUtils.pas

    It calls GetLocaleInfo API.

    Julian

  • Hi Julian

    1. Yes, this is way I do it, albeit with a temporary file.

    2. I default to inches if LocaleIsUSA=True

    function LocaleIsUSA: Boolean;
    const
    English_United_States_Locale = 1033;
    begin
    try
    Result := GetUserDefaultLCID = English_United_States_Locale;
    except
    Result := False;
    end;
    end;