Changing the style of added PowerPoint 2007 tables
Problem
When you add a new table to a slide in PowerPoint 2007, it takes on the default table style defined by the presentation's theme. Or template. Or something. But it may not be what you want. So how do you change the style?
Solution
This macro shows you the name and id of the selected table'scurrent style, then sets the style to the "No style, No grid" style.
By first choosing the style you want, you can view its id in the Immediate window, then copy/paste that into a modified version of the code below to set the style of a table in your own code.
Sub thing() Dim oTblStyle As TableStyle With ActiveWindow.Selection.ShapeRange(1) With .Table.Style Debug.Print .Name Debug.Print .Id End With With .Table .ApplyStyle ("{2D5ABB26-0587-4C30-8999-92F81FD0307C}") End With End With End Sub
See How do I use VBA code in PowerPoint? to learn how to use this example code.