Special language request

C

Charlotte E.

Hi guys,


If you make a small macro with this line:

MsgBox Application.ActivePrinter

....you'll get something like this:

"Adobe PDF on Ne09:"

My question is regarding the little word 'on'.

In Danish this little word is called 'på' thus the above code line would
return:

"Adobe PDF på Ne09:"


What would that word be in French (sur?), German (auf?) or Spannish???

Is there any way of finding out that little word on the current system?


TIA,

CE
 
W

Walter Briscoe

In message <[email protected]> of Thu, 10
Jan 2013 11:38:41 in microsoft.public.excel.programming, Charlotte E.
Hi guys,


If you make a small macro with this line:

MsgBox Application.ActivePrinter

...you'll get something like this:

"Adobe PDF on Ne09:"

My question is regarding the little word 'on'.

In Danish this little word is called 'på' thus the above code line
would return:

"Adobe PDF på Ne09:"


What would that word be in French (sur?), German (auf?) or Spannish???

Is there any way of finding out that little word on the current system?


TIA,

CE

I would use a regular expression to get that word.

This is pasted from my Immediate pane in VBA.


Set RE = CreateObject("VBScript.Regexp")
re.Pattern = "^.+ ([^ ]+) [^ ]+$"
?re.Replace("Adobe PDF på Ne09:","$1")

?re.Replace("Adobe PDF on Ne09:","$1")
on
 
W

witek

Charlotte said:
Hi guys,


If you make a small macro with this line:

MsgBox Application.ActivePrinter

...you'll get something like this:

"Adobe PDF on Ne09:"

My question is regarding the little word 'on'.

In Danish this little word is called 'på' thus the above code line would
return:

"Adobe PDF på Ne09:"


What would that word be in French (sur?), German (auf?) or Spannish???

Is there any way of finding out that little word on the current system?


TIA,

CE

Message depends on language set in Windows.
 
C

Charlotte E.

Message depends on language set in Windows.

Yes, I know :)

The question was, how to find that little word by VBA?


CE



Den 10.01.2013 18:21, witek skrev:
 
A

Auric__

Charlotte said:
If you make a small macro with this line:

MsgBox Application.ActivePrinter

...you'll get something like this:

"Adobe PDF on Ne09:"

My question is regarding the little word 'on'.

In Danish this little word is called 'på' thus the above code line would
return:

"Adobe PDF på Ne09:"


What would that word be in French (sur?), German (auf?) or Spannish???

For Spanish it's "en". Google says you have French and German right.
Is there any way of finding out that little word on the current system?

Some languages put the words in a different order (Japanese comes to mind)
so just knowing the one word might not necessarily be enough.

It looks like your string can be found in comdlg32.dll as string resource
1090. You can extract that with LoadString; there's a sample that can
possibly be adapted to your needs here:

http://support.microsoft.com/kb/232625

Basically, it's like this:

Dim hInst As Long, reslen As Long
'resString *must* be a fixed-length string
Dim resString As String * 256
hInst = LoadLibrary("comdlg32.dll")
'1090 is the string to extract
'and 256 is the size of the buffer
reslen = LoadString(hInst, 1090, resString, 256)
result$ = Trim$(Left$(resString, reslen))
FreeLibrary hInst

Your string will be in result$. (If you want to keep the spaces around the
word -- " on " instead of "on" -- remove Trim$.)

Of course, this assumes that localized versions of Windows have the actual
translated strings in the DLLs. (Since I've only ever used the US English
versions, I have no clue either way.) If you try this on a non-English
version and get "on" instead of the correct language, you'll need to dig it
out of somewhere else.
 
C

Charlotte E.

Thanks for your effort, guys :)

Found a way of getting it by standard VBA :)


CE



Den 11.01.2013 01:59, Auric__ skrev:
 
A

Auric__

Charlotte said:
Thanks for your effort, guys :)

Found a way of getting it by standard VBA :)

What I posted *was* standard VBA, I just left out the DECLAREs. ;-)

Out of curiosity, would you mind posting your solution? Or a link to where
you got it from, if applicable? I'd like to see it.
 

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