PDA

View Full Version : DefaultlanguageID



adamjancz
01-04-2011, 06:32 AM
Hi everybody,

I would like to know, what the defaultlanguageid really does - I supposed that when you change it, all future textboxes and shapes will have the languageid you set there. But that is not the case.
So, I can perfectly set the language of everything I have in my presentation, set the defaultlanguageid of it and then when I enter a new shape, it has still the wrong language. It's driving me nuts.
Anybody can help?

Best regards,
Aleks

adamjancz
01-04-2011, 07:07 AM
Found out that PP picks up the language from the keyboard settings. So two new questions:

1. Why? What's the purpose of defaultlanguageid then?
2. Can I prevent it?

Best regards and thanks

mancubus
01-07-2011, 02:02 PM
all applications use regional settings.

John Wilson
01-08-2011, 11:52 PM
Maybe you should say what version and OS you use and the code you use.
defaultlanguageID does what you expect here - all subsequent shapes and presentation default to that language.
2007 on Win 7
2010 on Win 7

adamjancz
01-10-2011, 04:28 AM
Hi,

thanks for the answer. I do something like:

Sub change()
Dim shpCurrentShape As Shape
Dim sldCurrentSlide As Slide

'Loop trough all shapes on all slides
For Each sldCurrentSlide In ActivePresentation.Slides
For Each shpCurrentShape In sldCurrentSlide.Shapes
'Text frames
If shpCurrentShape.HasTextFrame Then
'If there is no text in the shape, we will need to enter a placeholder
If shpCurrentShape.TextFrame.HasText = msoFalse Then
'No text
shpCurrentShape.TextFrame.TextRange = "[DUMMY]"
End If
shpCurrentShape.TextFrame.TextRange.LanguageID = msoLanguageIDGerman
'If the text range has been set by us, delete it
If shpCurrentShape.TextFrame.TextRange = "[DUMMY]" Then
shpCurrentShape.TextFrame.TextRange = ""
End If
End If
Next shpCurrentShape
Next sldCurrentSlide

'Set the language as default for whole presentation
ActivePresentation.DefaultLanguageID = msoLanguageIDGerman
End Sub
Now the funny thing is, that when I run it, it surely changes all the shapes into german. But when I then add a new slide, and click into a text box, it is shown as US English. When I then enter some text, it is shown as polish (my keyboard language).
In reality, I also change the languages on all the shapes in the masters as well, so this shouldn't be a problem - didn't want to post it here as not to over-complicate the code.

Now, what I can do is, I can turn the option in PP "Automatically switch keyboard to match language of surrounding text" on. Then everything works fine - but what if I want to keep my current keyboard setting - is there a way to stop PP from picking the keyboard language?

I'm using Office 2010, set to english as editing language, match windows as display language and match display as help language.

The windows is XP english.

I have US English, German and Polish installed as proofing languages.

I hope the above information help and I would be very thankfull for an answer to the question.

All the best in the new year to everybody!