A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Powerpoint, Publisher and Visio » Powerpoint
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Referring to a table by group name



 
 
Thread Tools Display Modes
  #1  
Old July 8th, 2008, 03:33 PM posted to microsoft.public.powerpoint
kitkat
external usenet poster
 
Posts: 13
Default 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  
Old July 8th, 2008, 08:41 PM posted to microsoft.public.powerpoint
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 10:56 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.