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  

PowerPoint tables and vba



 
 
Thread Tools Display Modes
  #1  
Old March 21st, 2007, 09:00 AM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default 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  
Old March 21st, 2007, 02:34 PM posted to microsoft.public.powerpoint
Shyam Pillai
external usenet poster
 
Posts: 622
Default 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  
Old March 21st, 2007, 02:50 PM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default 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  
Old March 21st, 2007, 03:39 PM posted to microsoft.public.powerpoint
John Wilson
external usenet poster
 
Posts: 6,023
Default 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

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 08:19 PM.


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