If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Referring to a table by group name
I read on a post on the MSForum website that if you want to reference a table
in a specific slide, you can do so by coding something along the lines of "For any object that is a shape of type = 19--apparently that's what a table is--, do such and such with it." I don't have Powerpoint 2007 and I'm not sure if you can only do that sort of thing with the new version...Anyway, I've got a macro that creates a new table each time the slide is run and so it needs to include some sort of naming code so I can refer back to the table once it's been created. My code so far (simple version) is below. If anyone could suggest a particular code to name the newly created tables, I would be ecstatic.... Public Sub create24rows() Dim lRows As Long Dim lCols As Long Dim sTLeft As Single Dim sTTop As Single Dim sTWidth As Single Dim sTHeight As Single Dim oTbl As Table ' Rows/Cols set here lRows = 4 lCols = 2 ' Set the size you want for the table here sTLeft = 150 sTTop = 150 sTWidth = 150 sTHeight = 150 ' Add the table Call ActivePresentation.Slides(13).Shapes.AddTable(lRow s, lCols, sTLeft, sTTop, sTWidth, sTHeight) Set oTbl = ?!?!?! (This is where I need to figure out how to reference the new table) With oTbl With .Cell(2, 1).Shape With .TextFrame.TextRange .Text = "Hope" End With End With End With End With End Sub |
#2
|
|||
|
|||
Referring to a table by group name
I've got a macro that creates a new table each time the slide is run and so it needs to include some sort of naming code so I can refer back to the table once it's been created. See the replies to your earlier posts and elsewhere in this same group about using tags rather than relying on names or index positions. Example code and more about tags he Working with Tags (and a bit about Functions) http://www.pptfaq.com/FAQ00815.htm ----------------------------------------- Steve Rindsberg, PPT MVP PPT FAQ: www.pptfaq.com PPTools: www.pptools.com ================================================ |
Thread Tools | |
Display Modes | |
|
|