From: Clifton Ivey on
I have a table I added via VBA like this:

set oTable = ActivePresentation.Slides("mySlide").Shapes.AddTable(...)

I then add some cells to it by:

oTable.Cell(...).Shape.TextFrame.TextRange.Text = "some text"

However, I cannot get a handle on these cells to update the font, fill, etc.

What is the best way to do this?
From: Steve Rindsberg on
On Sun, 13 Dec 2009 21:01:01 -0500, Clifton Ivey <clifton ivey
<"africom.mil>"> wrote:

> I have a table I added via VBA like this:
>
> set oTable = ActivePresentation.Slides("mySlide").Shapes.AddTable(...)
>
> I then add some cells to it by:
>
> oTable.Cell(...).Shape.TextFrame.TextRange.Text = "some text"
>
> However, I cannot get a handle on these cells to update the font, fill,
> etc.
>
> What is the best way to do this?

oTable.Cell(x,y).Shape gives you a reference to the shape that represents
the cell.
You can format it using the same properties as you would any other shape.




--
================================
Steve Rindsberg
PPTools add-ins for PowerPoint
http://www.pptools.com
The PowerPoint FAQ
http://www.pptfaq.com
From: Clifton Ivey on
Is there any way to modify them as a group? As opposed to modifying each
individual cell.

"Steve Rindsberg" wrote:

> On Sun, 13 Dec 2009 21:01:01 -0500, Clifton Ivey <clifton ivey
> <"africom.mil>"> wrote:
>
> > I have a table I added via VBA like this:
> >
> > set oTable = ActivePresentation.Slides("mySlide").Shapes.AddTable(...)
> >
> > I then add some cells to it by:
> >
> > oTable.Cell(...).Shape.TextFrame.TextRange.Text = "some text"
> >
> > However, I cannot get a handle on these cells to update the font, fill,
> > etc.
> >
> > What is the best way to do this?
>
> oTable.Cell(x,y).Shape gives you a reference to the shape that represents
> the cell.
> You can format it using the same properties as you would any other shape.
>
>
>
>
> --
> ================================
> Steve Rindsberg
> PPTools add-ins for PowerPoint
> http://www.pptools.com
> The PowerPoint FAQ
> http://www.pptfaq.com
> .
>
From: Steve Rindsberg on
In article <D9EA683C-6021-433D-9C87-5944B0DD9524(a)microsoft.com>, Clifton Ivey
wrote:
> Is there any way to modify them as a group? As opposed to modifying each
> individual cell.

If you find a way, I'd love to hear of it.
Somebody please! Expose my ignorance. ;-)

Cell by cell is the only way I'm aware of.
And man, is it ever SLOW.

One trick though: add as few rows/columns as you can to start, format them,
then add rows and colums as needed. MUCH faster than adding them first then
formatting.

>
> "Steve Rindsberg" wrote:
>
> > On Sun, 13 Dec 2009 21:01:01 -0500, Clifton Ivey <clifton ivey
> > <"africom.mil>"> wrote:
> >
> > > I have a table I added via VBA like this:
> > >
> > > set oTable = ActivePresentation.Slides("mySlide").Shapes.AddTable(...)
> > >
> > > I then add some cells to it by:
> > >
> > > oTable.Cell(...).Shape.TextFrame.TextRange.Text = "some text"
> > >
> > > However, I cannot get a handle on these cells to update the font, fill,
> > > etc.
> > >
> > > What is the best way to do this?
> >
> > oTable.Cell(x,y).Shape gives you a reference to the shape that represents
> > the cell.
> > You can format it using the same properties as you would any other shape.
> >
> >
> >
> >
> > --
> > ================================
> > Steve Rindsberg
> > PPTools add-ins for PowerPoint
> > http://www.pptools.com
> > The PowerPoint FAQ
> > http://www.pptfaq.com
> > .
> >


==============================
PPT Frequently Asked Questions
http://www.pptfaq.com/

PPTools add-ins for PowerPoint
http://www.pptools.com/


From: Clifton Ivey on
Thanks Steve. I am afraid you are correct and there is no simple way to do
what I want, but I had been led to believe from researching this that it may
be possible to interact with the cells in a table as a ShapeRange. I even
found a couple of examples, but couldn't get them to work.

The code I've tried looks like this:

With oSlide.Shapes.Range("myTablesName")
With .Fill
.Visible=True
.BackColor.SchemeColor = ppShadow
End With
With .TextFrame.TextRange.Font
.Italic = msoTrue
.Color.RGB = RGB(125, 0, 125)
End With
End With

======== end code ============

From what I've read I thought the cells are shapes embedded in the table
which is also a shape. So why can't I get a handle on it as a Range?

Thanks again,
Brian

"Steve Rindsberg" wrote:

> In article <D9EA683C-6021-433D-9C87-5944B0DD9524(a)microsoft.com>, Clifton Ivey
> wrote:
> > Is there any way to modify them as a group? As opposed to modifying each
> > individual cell.
>
> If you find a way, I'd love to hear of it.
> Somebody please! Expose my ignorance. ;-)
>
> Cell by cell is the only way I'm aware of.
> And man, is it ever SLOW.
>
> One trick though: add as few rows/columns as you can to start, format them,
> then add rows and colums as needed. MUCH faster than adding them first then
> formatting.
>
> >
> > "Steve Rindsberg" wrote:
> >
> > > On Sun, 13 Dec 2009 21:01:01 -0500, Clifton Ivey <clifton ivey
> > > <"africom.mil>"> wrote:
> > >
> > > > I have a table I added via VBA like this:
> > > >
> > > > set oTable = ActivePresentation.Slides("mySlide").Shapes.AddTable(...)
> > > >
> > > > I then add some cells to it by:
> > > >
> > > > oTable.Cell(...).Shape.TextFrame.TextRange.Text = "some text"
> > > >
> > > > However, I cannot get a handle on these cells to update the font, fill,
> > > > etc.
> > > >
> > > > What is the best way to do this?
> > >
> > > oTable.Cell(x,y).Shape gives you a reference to the shape that represents
> > > the cell.
> > > You can format it using the same properties as you would any other shape.
> > >
> > >
> > >
> > >
> > > --
> > > ================================
> > > Steve Rindsberg
> > > PPTools add-ins for PowerPoint
> > > http://www.pptools.com
> > > The PowerPoint FAQ
> > > http://www.pptfaq.com
> > > .
> > >
>
>
> ==============================
> PPT Frequently Asked Questions
> http://www.pptfaq.com/
>
> PPTools add-ins for PowerPoint
> http://www.pptools.com/
>
>
> .
>