ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Special language request (https://www.excelbanter.com/excel-programming/447967-special-language-request.html)

Charlotte E.[_3_]

Special language request
 
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

Walter Briscoe

Special language request
 
In message of Thu, 10
Jan 2013 11:38:41 in microsoft.public.excel.programming, Charlotte E.
writes
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

--
Walter Briscoe

witek

Special language request
 
Charlotte E. wrote:
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.


Charlotte E.[_3_]

Special language request
 
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:
Charlotte E. wrote:
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.


Auric__

Special language request
 
Charlotte E. wrote:

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 he

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.

--
I can't think of him as a foe.
He was one of the finest men I've ever known.

Charlotte E.[_3_]

Special language request
 
Thanks for your effort, guys :-)

Found a way of getting it by standard VBA :-)


CE



Den 11.01.2013 01:59, Auric__ skrev:
Charlotte E. wrote:

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 he

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.


Auric__

Special language request
 
Charlotte E. wrote:

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.

--
Yeah, that's the best solution.
Problem: Startup sound has been changed.
Solution: Change to a different operating system.
Can you spot the flaw in your logic?


All times are GMT +1. The time now is 11:31 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com