none
PowerPoint 2007 - Set default language of entire template RRS feed

  • Question

  • I have created several PowerPoint templates which has both Norwegian and English versions. However, I could not find a simple way of setting the default language on the entire template, so I managed to write some macro code does this:

     

     

    Sub changeLanguage(ByVal lang As String)
     On Error Resume Next
     
     If lang = "English" Then
      lang = msoLanguageIDEnglishUK
     ElseIf lang = "Norwegian" Then
      lang = msoLanguageIDNorwegianBokmol
     End If
     
     ActiveWindow.ViewType = ppViewSlideMaster
     
     For Each oLayout In ActivePresentation.SlideMaster.CustomLayouts
     oLayout.Select
     Dim oShape As Shape
     
     For Each oShape In oLayout.Shapes
      oShape.Select
      oShape.TextFrame.TextRange.LanguageID = lang
     Next
     Next
    
    End Sub
    

    This works, however, once I exit master view, it isn't set after all. Even though it is in Master View. I have also tried deleting the slide and creating a new one based on the master view custom layouts. Even in MasterView, if I don't select any shape then the language set is the default language, which I cannot seem to change. I mean, I can click a shape and set it's languange. And I can also click "Default" which sets the default language. But this seems like an application setting rather than a template specific setting. And this seems to override what I set via my macro. 

    Question is, is this actually impossible? All I want to do is to set the default language for each template, since there are two versions of the same template. One in Norwegian and one in English.

    Then I found this little snippet

    Activepresentation.DefaultLanguageID = 

    This changes the default langues of PowerPoint itself.. Why is it called ActivePresentation when it seems to be an application setting?
    Seems like I have to create a custom autorun makro that sets the language accordingly for the entire application once the template is loaded. Which consequences would this have if the user wants to create a new presentation without using one of the templates? He/she wouldn't understand why the language all of a sudden has changed! Either that or add two buttons for each language that the user needs to click. 

    Thursday, January 6, 2011 6:38 AM

Answers

  • Hi Kenny

    OK, after taking a quick look at this...

    Yes, the DefaultLanguageID does appear to apply to the application. MS has strange ideas about language and how it should be controlled, going all the way back to the mid-90's. I even met the person behind it all and he never did understand how this should work in a "professional" environment. His entire POV was on making it simple for the end-user to switch languages and on the premise that someone only ever uses one language. A smart guy, but that's something he never could understand... <sigh>

    The way it looks, I'd say your presentations need some kind of "Auto" macro or you need an Add-in. Create an TAG in each presentation with the language information for that presentation. When the presentation opens, the macro (or add-in) will set the DefaultLanguageID.

    You can either leave it like that, or have another macro (or event in the add-in) that restores the DefaultLanguageID when the presentation is closed.

    Or you're going to need code of some kind to apply the language to all the Shapes in the presentation, which could get quite complex, I'd think...


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Tuesday, January 11, 2011 9:50 AM
    • Marked as answer by Bruce Song Thursday, January 13, 2011 3:03 AM
    Friday, January 7, 2011 9:41 AM
    Moderator

All replies

  • Hi Kenny

    You might want to try asking this in the specialized PowerPoint forums on Answers, as that's where the application specialists hang out:

    http://social.answers.microsoft.com/Forums/en-US/group/Office

    They tend to know a lot more about these kinds of "nasty little details"...


    Cindy Meister, VSTO/Word MVP
    Thursday, January 6, 2011 8:46 PM
    Moderator
  • Yeah, they were the ones who sent me here actually. 
    Friday, January 7, 2011 9:07 AM
  • Yeah, they were the ones who sent me here actually. 


    Ah? Something they don't know? That surprises me :-) I thought those MVPs were omniscient when it comes to PowerPoint... (It was an MVP who pointed you here and not someone else?)

    Which version are you struggling with? Edit: 2007... <sigh>

    Edit: I don't find that thread when I search Answers?


    Cindy Meister, VSTO/Word MVP
    Friday, January 7, 2011 9:16 AM
    Moderator
  • Hi Kenny

    OK, after taking a quick look at this...

    Yes, the DefaultLanguageID does appear to apply to the application. MS has strange ideas about language and how it should be controlled, going all the way back to the mid-90's. I even met the person behind it all and he never did understand how this should work in a "professional" environment. His entire POV was on making it simple for the end-user to switch languages and on the premise that someone only ever uses one language. A smart guy, but that's something he never could understand... <sigh>

    The way it looks, I'd say your presentations need some kind of "Auto" macro or you need an Add-in. Create an TAG in each presentation with the language information for that presentation. When the presentation opens, the macro (or add-in) will set the DefaultLanguageID.

    You can either leave it like that, or have another macro (or event in the add-in) that restores the DefaultLanguageID when the presentation is closed.

    Or you're going to need code of some kind to apply the language to all the Shapes in the presentation, which could get quite complex, I'd think...


    Cindy Meister, VSTO/Word MVP
    • Proposed as answer by Bruce Song Tuesday, January 11, 2011 9:50 AM
    • Marked as answer by Bruce Song Thursday, January 13, 2011 3:03 AM
    Friday, January 7, 2011 9:41 AM
    Moderator