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
|
|||
|
|||
PowerPoint tables and vba
Having a problem with this.
We need to check which cell the cursor is in in a PPT table using vba. I know how to iterate through the table and I figured .cell(Irow,Icol).selected would tell me but it' s coming up false in all cells (even if I actually select the text) Using 2003 SP2 Any ideas (Shyam I'm looking at you! - I've seen the relevant page on your site but that comes up no cells selected too) -- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk |
#2
|
|||
|
|||
PowerPoint tables and vba
John,
The code snippet I have on my site works for cells which are selected and not for the cells which have text selected in them. The Selected property is True only when the entire cell is selected. You can always get a reference back to the cell containing the text using the Parent property. Assuming that you've written the code to check if it is a table shape, you can retrieve the shape which holds the cursor/text selection as follows: Dim oShp As Shape Set oShp = ActiveWindow.Selection.TextRange.Parent.Parent Read as: ActiveWindow.Selection.TextRange.Parent(TextFrame) .Parent(Shape) This shape reference is to the rectangle contained within the table, you can now manipulate the same as a regular shape. Note that this does not work in PPT 2007. The OM is broken. -- Regards, Shyam Pillai Image Importer Wizard http://skp.mvps.org/iiw.htm "John Wilson" john AT technologytrish.co DOT uk wrote in message ... Having a problem with this. We need to check which cell the cursor is in in a PPT table using vba. I know how to iterate through the table and I figured .cell(Irow,Icol).selected would tell me but it' s coming up false in all cells (even if I actually select the text) Using 2003 SP2 Any ideas (Shyam I'm looking at you! - I've seen the relevant page on your site but that comes up no cells selected too) -- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk |
#3
|
|||
|
|||
PowerPoint tables and vba
Thanks Shyam. I'm off to try that. It's for an XP user so it should be OK.
-- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk "Shyam Pillai" wrote: John, The code snippet I have on my site works for cells which are selected and not for the cells which have text selected in them. The Selected property is True only when the entire cell is selected. You can always get a reference back to the cell containing the text using the Parent property. Assuming that you've written the code to check if it is a table shape, you can retrieve the shape which holds the cursor/text selection as follows: Dim oShp As Shape Set oShp = ActiveWindow.Selection.TextRange.Parent.Parent Read as: ActiveWindow.Selection.TextRange.Parent(TextFrame) .Parent(Shape) This shape reference is to the rectangle contained within the table, you can now manipulate the same as a regular shape. Note that this does not work in PPT 2007. The OM is broken. -- Regards, Shyam Pillai Image Importer Wizard http://skp.mvps.org/iiw.htm "John Wilson" john AT technologytrish.co DOT uk wrote in message ... Having a problem with this. We need to check which cell the cursor is in in a PPT table using vba. I know how to iterate through the table and I figured .cell(Irow,Icol).selected would tell me but it' s coming up false in all cells (even if I actually select the text) Using 2003 SP2 Any ideas (Shyam I'm looking at you! - I've seen the relevant page on your site but that comes up no cells selected too) -- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk |
#4
|
|||
|
|||
PowerPoint tables and vba
Thanks that has helped a lot!
-- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk "Shyam Pillai" wrote: John, The code snippet I have on my site works for cells which are selected and not for the cells which have text selected in them. The Selected property is True only when the entire cell is selected. You can always get a reference back to the cell containing the text using the Parent property. Assuming that you've written the code to check if it is a table shape, you can retrieve the shape which holds the cursor/text selection as follows: Dim oShp As Shape Set oShp = ActiveWindow.Selection.TextRange.Parent.Parent Read as: ActiveWindow.Selection.TextRange.Parent(TextFrame) .Parent(Shape) This shape reference is to the rectangle contained within the table, you can now manipulate the same as a regular shape. Note that this does not work in PPT 2007. The OM is broken. -- Regards, Shyam Pillai Image Importer Wizard http://skp.mvps.org/iiw.htm "John Wilson" john AT technologytrish.co DOT uk wrote in message ... Having a problem with this. We need to check which cell the cursor is in in a PPT table using vba. I know how to iterate through the table and I figured .cell(Irow,Icol).selected would tell me but it' s coming up false in all cells (even if I actually select the text) Using 2003 SP2 Any ideas (Shyam I'm looking at you! - I've seen the relevant page on your site but that comes up no cells selected too) -- Amazing PPT Hints, Tips and Tutorials-http://www.PPTAlchemy.co.uk http://www.technologytrish.co.uk/ppttipshome.html email john AT technologytrish.co.uk |
Thread Tools | |
Display Modes | |
|
|