isabelle r
10-13-2016, 01:23 AM
Hello,
I'm working on presentations in which most of the text is contained in shapes, sometimes in multiple shapes grouped together.
These presentations are then translated into different languages, and as the language proofing tools in PPT are really terrible, I wanted to use a macro to set the spell-check language automatically for the entire presentation.
I found something online, but for some reason, it only changes the spell-checking language on some shapes, but others stubbornly remain in the original language.
This is the code:
Option Explicit
Public Sub ChangeSpellCheckingLanguage()
Dim j As Integer, k As Integer, scount As Integer, fcount As Integer
scount = ActivePresentation.Slides.Count
For j = 1 To scount
fcount = ActivePresentation.Slides(j).Shapes.Count
For k = 1 To fcount
If ActivePresentation.Slides(j).Shapes(k).HasTextFrame Then
ActivePresentation.Slides(j).Shapes(k) _
.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next k
Next j
End Sub
I can more-or-less find my way around macros in Excel, but PPT macros confuse me and I really can't see what's wrong here. :banghead:
Could someone please help me see where the issue is with this macro, and what to change so that it applies the selected spell-check language to all elements in the presentation, be they text areas, stand-alone shapes or grouped shapes (sometimes containing sub-groups)?
Thank you for your help,
-Isa
I'm working on presentations in which most of the text is contained in shapes, sometimes in multiple shapes grouped together.
These presentations are then translated into different languages, and as the language proofing tools in PPT are really terrible, I wanted to use a macro to set the spell-check language automatically for the entire presentation.
I found something online, but for some reason, it only changes the spell-checking language on some shapes, but others stubbornly remain in the original language.
This is the code:
Option Explicit
Public Sub ChangeSpellCheckingLanguage()
Dim j As Integer, k As Integer, scount As Integer, fcount As Integer
scount = ActivePresentation.Slides.Count
For j = 1 To scount
fcount = ActivePresentation.Slides(j).Shapes.Count
For k = 1 To fcount
If ActivePresentation.Slides(j).Shapes(k).HasTextFrame Then
ActivePresentation.Slides(j).Shapes(k) _
.TextFrame.TextRange.LanguageID = msoLanguageIDEnglishUK
End If
Next k
Next j
End Sub
I can more-or-less find my way around macros in Excel, but PPT macros confuse me and I really can't see what's wrong here. :banghead:
Could someone please help me see where the issue is with this macro, and what to change so that it applies the selected spell-check language to all elements in the presentation, be they text areas, stand-alone shapes or grouped shapes (sometimes containing sub-groups)?
Thank you for your help,
-Isa