Results 1 to 19 of 19

Thread: Macro to change language for all boxes in a presentation

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    VBAX Master
    Joined
    Feb 2007
    Posts
    2,096
    Location
    Try

    Sub toSpanish()
    Dim osld As Slide
    Dim oshp As Shape
    Dim L As Long
    For Each osld In ActivePresentation.Slides
       For Each oshp In osld.Shapes
          If oshp.Type = msoGroup Then
            For L = 1 To oshp.GroupItems.Count
               If oshp.GroupItems(L).HasTextFrame Then
                  oshp.GroupItems(L).TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
               End If
               Next L
            End If
        If oshp.HasTextFrame Then
           oshp.TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
        End If
    Next oshp
    For Each oshp In osld.NotesPage.Shapes
       If oshp.HasTextFrame Then
          oshp.TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
       End If
    Next oshp
    Next osld
     End Sub
    John Wilson
    Microsoft PowerPoint MVP
    Amazing Free PowerPoint Tutorials
    http://www.pptalchemy.co.uk/powerpoi...tutorials.html

  2. #2
    VBAX Regular
    Joined
    Nov 2021
    Posts
    11
    Location
    Quote Originally Posted by John Wilson View Post
    Try

    Sub toSpanish()
    Dim osld As Slide
    Dim oshp As Shape
    Dim L As Long
    For Each osld In ActivePresentation.Slides
       For Each oshp In osld.Shapes
          If oshp.Type = msoGroup Then
            For L = 1 To oshp.GroupItems.Count
               If oshp.GroupItems(L).HasTextFrame Then
                  oshp.GroupItems(L).TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
               End If
               Next L
            End If
        If oshp.HasTextFrame Then
           oshp.TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
        End If
    Next oshp
    For Each oshp In osld.NotesPage.Shapes
       If oshp.HasTextFrame Then
          oshp.TextFrame2.TextRange.LanguageID = msoLanguageIDSpanish
       End If
    Next oshp
    Next osld
     End Sub
    It works THANK YOU!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •