Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 280
  • Last Modified:

VBA: Set Language for Tables

Hello, I'm trying to use VBA to change the language for some PPTs I have. The code below works fine for changing the language of the presentation and its textboxes, but some of the PPTs have tables with text in them too.

Does anyone know how to change the LanguageID on tables?

Thank you in advance!

------------------------------------
' Declare variables.
   Dim sld As Slide
   Dim shp As Shape
 
   ' Loop through all the slides in the presentation.
   For Each sld In ActivePresentation.Slides
   
     'change this to the language..
   ActiveWindow.Presentation.DefaultLanguageID = msoLanguageIDBrazilianPortuguese
   
For Each shp In sld.Shapes
 
   If shp.HasTextFrame Then
              'change this to the language..
              shp.TextFrame.TextRange.LanguageID = msoLanguageIDBrazilianPortuguese
   End If

   If shp.HasTable Then
 'I can't find how to change the LanguageID for a table.
   End If
Next
Next
0
YoungBonzi
Asked:
YoungBonzi
1 Solution
 
R_RajeshCommented:
Dim sld As Slide
   Dim shp As Shape
 
   ' Loop through all the slides in the presentation.
   For Each sld In ActivePresentation.Slides
   
     'change this to the language..
   ActiveWindow.Presentation.DefaultLanguageID = msoLanguageIDBrazilianPortuguese
   
For Each shp In sld.Shapes
 
   If shp.HasTextFrame Then
              'change this to the language..
              shp.TextFrame.TextRange.LanguageID = msoLanguageIDBrazilianPortuguese
   End If

   If shp.HasTable Then
 'I can't find how to change the LanguageID for a table.
    For Each r In shp.Table.Rows
        For Each c In r.Cells
            c.Shape.TextFrame.TextRange.LanguageID = msoLanguageIDBrazilianPortuguese
        Next c
    Next r
   End If
Next
Next
0
 
YoungBonziAuthor Commented:
Thank you Rajesh! Can I ask how you figured that out?
0

Featured Post

[Webinar On Demand] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now