я попробовал трюк объяснил в обсуждение, но не удалось изменить язык проверки правописания для всех текстов во всех слайдах презентации PowerPoint 2007.
может ли это быть характеристика из PowerPoint 2007?
следующий VBA "монстр" сделал свою работу, но я ищу более простой способ, который не требует VBA. Есть идеи?
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