Thursday, April 24, 2008

How to Set the Language in a PowerPoint presentation

To change the language of all text in all slides (including the Notes of the slides), use the following macro:

Sub SetLangUK()
'set language to UK for all slides and notes:
Dim scount, j, k, fcount
scount = ActivePresentation.Slides.Count
For j = 1 To scount
fcount = ActivePresentation.Slides(j).Shapes.Count
For k = 1 To fcount 'change all shapes:
If ActivePresentation.Slides(j).Shapes(k).HasTextFrame Then
ActivePresentation.Slides(j).Shapes(k).TextFrame _
.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next k
'change notes:
fcount = ActivePresentation.Slides(j).NotesPage.Shapes.Count
For k = 1 To fcount 'change all shapes:
If ActivePresentation.Slides(j).NotesPage.Shapes(k).HasTextFrame Then
ActivePresentation.Slides(j).NotesPage.Shapes(k).TextFrame _
.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next k
Next j
End Sub

I got half of this code from Antonín Otáhal and added the part about the NotesPage.

11 comments:

  1. Finlay!!!
    Thank you so much!!!!!!!!!!
    I can't believe I need a macro for sth like that.
    Stupid PowerPoint!

    ReplyDelete
  2. Brilliant! I cannot believe this is not a standard option in PowerPoint 2007.

    ReplyDelete
  3. Suzanne1:56 PM

    How do adapt the macro to set it for another language, like Dutch (Netherlands) or Spanish (Spain)?

    ReplyDelete
  4. Anonymous4:49 PM

    Warm thanks Anthonin and Demetris! This code is a real life saver.

    ReplyDelete
  5. Thank you, this just saved my presentation!

    ReplyDelete
  6. Anonymous12:33 PM

    Thank you so much!!!

    ReplyDelete
  7. Anonymous8:06 PM

    If Powerpoint was just launched by a start up company, it would get pretty bad reviews. And no-one would buy it.

    ReplyDelete
  8. Anonymous3:37 PM

    Thanks!! This is awesome...

    ReplyDelete
  9. Anonymous3:40 PM

    For those looking for alternate languages you can do a search for "msoLanguageID"
    or go to mricrosoft's page:
    http://msdn.microsoft.com/en-us/library/office/aa432635(v=office.12).aspx

    ReplyDelete
  10. Anonymous6:16 PM

    Absolutely great, thanks a lot. Also works with Hungarian which I needed

    ReplyDelete
  11. Anonymous2:57 PM

    Thanks a lot :)
    Really appreciate the code, very helpful.

    ReplyDelete