Skip to content

Instantly share code, notes, and snippets.

@erikvullings
Last active February 15, 2024 10:17
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erikvullings/f197ee68c6119a28d070926175690812 to your computer and use it in GitHub Desktop.
Save erikvullings/f197ee68c6119a28d070926175690812 to your computer and use it in GitHub Desktop.
Change the language of your PowerPoint presentation
'Change the language of your PowerPoint
'In newer PowerPoint version, you need to first save your PowerPoint with macros enabled.
'Go to the VIEW tab, select MACROS (at the right), enter a name, e.g. toEnglish, and press create to enter below text.
'Now you can run the macro from the same menu.
'Alternatively, but less complete, go to the VIEW tab, select OUTLINE, select all slides (using CTRL-A).
'Now go to the REVIEW tab, select Language, and change the proofing language.
'Also make sure that you set the WINDOWS Language (taskbar, bottom right) to the preferred language, otherwise all new text
'will have the same problem (Press CTRL + WINDOWS + SPACE to switch the Keyboard input language).
Option Explicit
Sub toEnglish()
Dim iRows, iCol, j, k, m, scount, fcount, gcount, language As Integer
'A list of languages can be found here: https://docs.microsoft.com/en-us/previous-versions/office/developer/office-2007/aa432635(v=office.12)
'For example, US English is msoLanguageIDEnglishUS, or if you prefer Dutch, use msoLanguageIDDutch
language = msoLanguageIDEnglishUK
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 = language
End If
If ActivePresentation.Slides(j).Shapes(k).Type = msoGroup Then
gcount = ActivePresentation.Slides(j).Shapes(k).GroupItems.Count
For m = 1 To gcount
If ActivePresentation.Slides(j).Shapes(k).GroupItems.Item(m).HasTextFrame Then
ActivePresentation.Slides(j).Shapes(k).GroupItems.Item(m) _
.TextFrame.TextRange.LanguageID = language
End If
Next m
End If
If ActivePresentation.Slides(j).Shapes(k).Type = msoTable Or _
ActivePresentation.Slides(j).Shapes(k).HasTable Then
Dim oShp As Shape
Set oShp = ActivePresentation.Slides(j).Shapes(k)
For iRows = 1 To oShp.Table.Rows.Count
For iCol = 1 To oShp.Table.Rows(iRows).Cells.Count
oShp.Table.Rows(iRows).Cells(iCol).Shape.TextFrame.TextRange.LanguageID = language
Next
Next
End If
Next k
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 = language
End If
Next k
Next j
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment