3

I tried the trick explained in a related discussion, but could not change the proofing language for all texts in all slides of a PowerPoint 2007 presentation.

Could this be a feature of PowerPoint 2007?

The following VBA "monster" did the job, but I am looking for an easier way which does not require VBA. Any ideas?

Option Explicit

Private Sub btnGerman_Click()
    Call LanguageChange(msoLanguageIDGerman)
End Sub

Private Sub btnEnglish_Click()
    Call LanguageChange(msoLanguageIDEnglishUK)
End Sub

Public Sub LanguageChange(LanguageID As Integer)
    Dim sld As Slide
    Dim shp As Shape
    Dim cnt As Integer
    Dim cntAll As Integer

    On Error GoTo ErrHandler
    Me.btnEnglish.Enabled = False
    Me.btnGerman.Enabled = False
    cntAll = ActivePresentation.Slides.Count
    cnt = 0
    For Each sld In ActivePresentation.Slides
        For Each shp In sld.Shapes
            If shp.HasTextFrame Then
                shp.TextFrame.TextRange.LanguageID = LanguageID
            Else
                ShapeLanguageChange shp, LanguageID
            End If
        Next
        cnt = cnt + 1
        o cnt & " / " & cntAll
    Next

    Me.btnEnglish.Enabled = True
    Me.btnGerman.Enabled = True
    Exit Sub

ErrHandler:
    MsgBox "Ooops! " & Err.Description, vbCritical, "Error!"
    Err.Clear
    Me.btnEnglish.Enabled = True
    Me.btnGerman.Enabled = True
End Sub

Private Sub o(s As String)
    Me.Label1.Caption = s
    DoEvents
End Sub

Private Sub ShapeLanguageChange(sh As Shape, LanguageID As Integer)
    Dim sha As Shape

    If sh.Type = msoGroup Then
        For Each sha In sh.GroupItems
            If sha.Type = msoGroup Then
                ShapeLanguageChange sha, LanguageID
            ElseIf sha.HasTextFrame Then
                sha.TextFrame.TextRange.LanguageID = LanguageID
            End If
        Next
    End If
End Sub
Axel Kemper
  • 4,038

1 Answers1

2

You cannot do that without using VBA. There are lots of VBA code around, in the links below, e.g. You are already using recursion, which is essential to navigate groups. Other more complete pieces of code also deal with slide masters, notes, etc.

Change the spell-checking language on a PowerPoint presentation

How do I change the language of all Powerpoint slides at once?

https://stackoverflow.com/questions/4735765/powerpoint-2007-set-language-on-tables-charts-etc-that-contains-text