Referencing selected table cell

P

Pete

Hi,
I'm working with the Powerpoint object model for an Office add-in using .Net
2003. I can't figure out how to get a reference to a selected table cell. I
can get a reference to the table containing that cell using the Selection
object (...ShapeRange.Item(1)) or a specified cell in that table using the
Cell method e.g. Cell(1,1) etc but can someone tell me how to get a reference
to the cell that the user has clicked in? I'll probably want to do this on
the WindowSelectionChange event.
Thanks.
Pete
 
J

John Wilson

Had a similar problem a few weeks back (not in .net though) Shyam helped me
out with this suggestion to reference the shape clicked in within a table
(which is really only a collection of shapes)

Dim oShp As Shape
Set oShp = ActiveWindow.Selection.TextRange.Parent.Parent

Hpe that helps (did for me)
 
P

Pete

Hi John,

Thanks for the reply. I did apply that exact same workaround earlier today
which gives me 90% of what I need. Unfortunately you can't use
....TextRange.Parent.Parent.Parent to get the cell (or anything that you can
convert into a cell) which would have been ideal. I actually wanted to get
access to the Borders property of the cell so I could copy the formatting but
this is a "nice to have" feature and I think I can live with just accessing
the shape object. Thanks anyway.

Pete
 

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