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
2
  • It seems that your code is the only good idea. I can't find any property or method which could set language of existing presentation with effect for all text within document. What I find works rather for new presentation, unfortunately. Apr 15, 2013 at 20:35
  • KazJaw is correct. While you could in theory do a lot of the work manually, the amount of effort involved is astonishing. If you're after a ready-made solution, I have commercial add-in for this at pptools.com/languageselector and even that doesn't pick up some odds and ends (charts and such). Jun 19, 2013 at 14:08

1 Answer 1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .