View Single Post
 
Old 07-07-2014, 11:37 PM
JohnWilson JohnWilson is offline Windows 7 64bit Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,913
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

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.
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 07-08-2014 at 12:54 AM.
Reply With Quote