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.

6 Comments:

Blogger hrvoje said...

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

5:04 PM  
Anonymous Rhonda said...

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

4:43 AM  
Anonymous Suzanne said...

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

1:56 PM  
Anonymous Anonymous said...

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

4:49 PM  
Blogger xMort said...

Thank you, this just saved my presentation!

2:18 PM  
Anonymous Anonymous said...

Thank you so much!!!

12:33 PM  

Post a Comment

<< Home