Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 147
Default 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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default 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.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default 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.
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 160
Default 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.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 538
Default 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?
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 279
Default 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
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
special characters, other multi-language gotchas? Jeff Norville Excel Programming 0 November 16th 10 11:15 PM
How to change German language data into Eglish Language in a colum Execel work sheet language problems Excel Discussion (Misc queries) 1 October 29th 07 09:59 PM
language support in excel sheet using a third party language tool seema Excel Worksheet Functions 0 March 13th 06 06:06 AM
How can I programatically change the language in the language bar? Roy Barr Excel Programming 0 March 14th 05 09:55 PM
How to change the excel format from language to language? zee Excel Discussion (Misc queries) 2 January 30th 05 06:51 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"