AddTable function in PowerPoint VBA

J

Jackie

I am using the AddTable function available in PowerPoint. I am creating a
table with 5 rows and 10 columns. When the table creates it does not take up
the whole Shape Range area on the slide but if I create the table via
clicking the button on the slide it takes the whole Shape Range.

I did record a macro to see if it could point me in the right direction but
the macro did not record the information (in fact it recorded just two lines
of code which did not relate to the table !!).

Any help would be greatly appreciated.

Regards
Jackie
 
J

Jackie

Many thanks Steve.

Regards
Jackie


Steve Rindsberg said:
Sub Macro1()
Dim lRows As Long
Dim lCols As Long
Dim sTLeft As Single
Dim sTTop As Single
Dim sTWidth As Single
Dim sTHeight As Single

' Rows/Cols set here
lRows = 3
lCols = 5

' Set the size you want for the table here
sTLeft = 0
sTTop = 0
sTWidth = ActivePresentation.PageSetup.SlideWidth
sTHeight = ActivePresentation.PageSetup.SlideHeight

' Add the table
Call ActivePresentation.Slides(1).Shapes.AddTable(lRows, lCols, sTLeft,
sTTop, sTWidth, sTHeight)

End Sub


-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top