Pretty much the same
Dim myDocument As Slide
Set myDocument = ActivePresentation.Slides(1)
With myDocument.Shapes.addTable(NumRows:=3, NumColumns:=4, Left:=10, Top:=50)
.Name = "Red Square"
End With
However I hate myDocument being used to refer to a slide (I know it comes from Microsoft help but it's wrong - slides are not documents)
Sub addTable()
Dim mySlide As Slide
Dim myTable As Shape
Set mySlide = ActivePresentation.Slides(1)
Set myTable = mySlide.Shapes.addTable(NumRows:=3, NumColumns:=4, Left:=10, Top:=50)
myTable.Name = "Red Square"
End Sub
You will find it difficult to use hotkeys in PPT BTW.
Last edited by JohnWilson; 07-08-2014 at 12:54 AM.
|