I want to set English US as default language for all shapes on my slides.
It seems the object model for PPT has changed over the years because none of the >5 years old macros here 1, 2 work.
I get the error
Method or data member not found
when trying to set the language to a shape
currentShape.DefaultLanguageID = lang
I'm using PowerPoint v16.98 (25060824) for MacOS
Here are two version of my macro:
Version 1
Sub SetLanguageForAllText()
Dim sld As Slide
Dim shp As Shape
Dim master As Design
Dim layout As Object
Dim langID As MsoLanguageID
Dim tr As TextRange
Dim i As Integer
langID = msoLanguageIDEnglishUS
' Update all normal slides
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.LanguageID = langID
End If
End If
Next shp
Next sld
' Update master slide text
For Each master In ActivePresentation.Designs
' Master Shapes
For Each shp In master.SlideMaster.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.LanguageID = langID
End If
End If
Next shp
' Layouts
For Each layout In master.SlideMaster.CustomLayouts
For Each shp In layout.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
shp.TextFrame.TextRange.LanguageID = langID
End If
End If
Next shp
Next layout
Next master
MsgBox "Language set for all text to: " & langID, vbInformation
End Sub
Version 2
Sub SetDefaultLanguage()
Dim sld As Slide
Dim shp As Shape
Dim tr As TextRange
Dim i As Integer
Dim langID As MsoLanguageID
Dim master As Design
Dim layout As Object
langID = msoLanguageIDEnglishUS
' Loop through normal slides
For Each sld In ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
Set tr = shp.TextFrame.TextRange
For i = 1 To tr.Runs.Count
tr.Runs(i).LanguageID = langID
Next i
End If
End If
Next shp
Next sld
' Loop through master slides and layouts
For Each master In ActivePresentation.Designs
For Each shp In master.SlideMaster.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
Set tr = shp.TextFrame.TextRange
For i = 1 To tr.Runs.Count
tr.Runs(i).LanguageID = langID
Next i
End If
End If
Next shp
For Each layout In master.SlideMaster.CustomLayouts
For Each shp In layout.Shapes
If shp.HasTextFrame Then
If shp.TextFrame.HasText Then
Set tr = shp.TextFrame.TextRange
For i = 1 To tr.Runs.Count
tr.Runs(i).LanguageID = langID
Next i
End If
End If
Next shp
Next layout
Next master
MsgBox "Language set to: " & langID, vbInformation
End Sub


DefaultLanguageIDin your code ... which, btw, compiles and runs under Windows. A TextRange has aLanguageID- as in your code.DefaultLanguageIDis a property of the Presentation object -->ActivePresentation.DefaultLanguageID = msoLanguageIDEnglishUSTextRange.LanguageID. As you can see on the second screenshot, I get the same error forActivePresentation.DefaultLanguageID = msoLanguageIDEnglishUS