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  

list properties that belong to a shape



 
 
Thread Tools Display Modes
  #1  
Old March 21st, 2008, 09:42 PM posted to microsoft.public.office.developer.vba,microsoft.public.powerpoint,microsoft.public.office.developer.automation
Dale Fye
external usenet poster
 
Posts: 2,651
Default list properties that belong to a shape

I would like to list the properties that apply to shapes of various types.
Specifically, I'm looking for those properties that might contain text.

As an example, the other day, I found out that I could create screen tips
that show up when I mouse over a shape.

Is there a way to do something like

Dim prop as property

'What I would like to do here is be able to select a shape in the active
presentation, then run a macro that uses the selected shape
'I still have not figured out how to do that part, so I generally do
something like the following line and iterate through the shape numbers till
I get the one I'm looking for.

set oShp = activewindow.presentations.slides(x).shapes(y)
oShp.Select

debug.print oShp.Name, oShp.Type
For each prop in oshp.properties
debug.print prop.name, prop.value
next


  #2  
Old March 22nd, 2008, 04:17 AM posted to microsoft.public.office.developer.vba,microsoft.public.powerpoint,microsoft.public.office.developer.automation
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default list properties that belong to a shape

I'm not clear on what you're after.

If you want to list the properties of a selected shape you can:

With ActiveWindow.Selection.ShapeRange(1)
' List the properties you want:
Debug.Print .Left
Debug.Print .Top
' etc
End With

But you have to know what properties you want in advance. There's no
collection of properties you can iterate through.

In article , Dale Fye wrote:
I would like to list the properties that apply to shapes of various types.
Specifically, I'm looking for those properties that might contain text.

As an example, the other day, I found out that I could create screen tips
that show up when I mouse over a shape.

Is there a way to do something like

Dim prop as property

'What I would like to do here is be able to select a shape in the active
presentation, then run a macro that uses the selected shape
'I still have not figured out how to do that part, so I generally do
something like the following line and iterate through the shape numbers till
I get the one I'm looking for.

set oShp = activewindow.presentations.slides(x).shapes(y)
oShp.Select

debug.print oShp.Name, oShp.Type
For each prop in oshp.properties
debug.print prop.name, prop.value
next


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

  #3  
Old March 22nd, 2008, 11:45 AM posted to microsoft.public.office.developer.vba,microsoft.public.powerpoint,microsoft.public.office.developer.automation
Dale Fye
external usenet poster
 
Posts: 2,651
Default list properties that belong to a shape

Steve,

Thanks for your responses, to this and my other questions. They have been
very helpful.

Basically, I'm looking for a way to loop through a PPT presentation, and
identify every text string that could be embedded in the presentation
(whether it is visible to the viewer or not). I'm looking for text that is
in textboxes, captions, lists, control tips, alternate text, default values,
....

In Access, my Office application of choice, each object has a properties
collection, I just assumed that PPT objects would have the same collection .
If I write:

Dim prop As Property
Set obj = Forms("frm_Splash").cbo_Slide
On Error Resume Next
For Each prop In obj.Properties
Debug.Print prop.Name, prop.Type, prop.Value
Next

Then I'll get a list of 50 or so properties (see a partial list below) that
belong to that combo box. By restricting my search to those properties with
Type=8 (text), I can quickly search through all of the properties, and
capture the control, the property, and the value associated with that text
property. Since PPT does not seem to have this functionality. I'm going to
have to identify all of the various object types, then search to see what
properties they have and check for those properties individually. This will
involve a huge amount of additional reseearch and coding.

EventProcPrefix 8 cbo_Slide
Name 8 cbo_Slide
ControlType 2 111
ControlSource 8
Format 8
ConditionalFormat 8209 Null
DecimalPlaces 2 255
InputMask 8
RowSourceType 8 Table/Query
RowSource 8 qry_frm_Splash_cbo_Slide_Num
ColumnCount 2 1
ColumnHeads 11 False
ColumnWidths 8
BoundColumn 3 1
ListRows 2 8
ListWidth 8 0
StatusBarText 8
LimitToList 11 False
AutoExpand 11 True
DefaultValue 8
IMEHold 11 False
IMEMode 2 0
IMESentenceMode 2 3
ValidationRule 8
ValidationText 8
Visible 11 True
DisplayWhen 2 0
Enabled 11 True
Locked 11 False
AllowAutoCorrect 11 True
TabStop 11 True
TabIndex 2 5
Left 2 8880
Top 2 1140
Width 2 1920
Height 2 259
BackStyle 2 1
BackColor 3 16777215
SpecialEffect 2 2

"Steve Rindsberg" wrote in message
...
I'm not clear on what you're after.

If you want to list the properties of a selected shape you can:

With ActiveWindow.Selection.ShapeRange(1)
' List the properties you want:
Debug.Print .Left
Debug.Print .Top
' etc
End With

But you have to know what properties you want in advance. There's no
collection of properties you can iterate through.

In article , Dale Fye wrote:
I would like to list the properties that apply to shapes of various
types.
Specifically, I'm looking for those properties that might contain text.

As an example, the other day, I found out that I could create screen tips
that show up when I mouse over a shape.

Is there a way to do something like

Dim prop as property

'What I would like to do here is be able to select a shape in the active
presentation, then run a macro that uses the selected shape
'I still have not figured out how to do that part, so I generally do
something like the following line and iterate through the shape numbers
till
I get the one I'm looking for.

set oShp = activewindow.presentations.slides(x).shapes(y)
oShp.Select

debug.print oShp.Name, oShp.Type
For each prop in oshp.properties
debug.print prop.name, prop.value
next


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



  #4  
Old March 25th, 2008, 02:46 AM posted to microsoft.public.office.developer.vba,microsoft.public.powerpoint,microsoft.public.office.developer.automation
Steve Rindsberg
external usenet poster
 
Posts: 9,366
Default list properties that belong to a shape

Thanks for your responses, to this and my other questions. They have been
very helpful.

Basically, I'm looking for a way to loop through a PPT presentation, and
identify every text string that could be embedded in the presentation
(whether it is visible to the viewer or not). I'm looking for text that is
in textboxes, captions, lists, control tips, alternate text, default values,
....

In Access, my Office application of choice, each object has a properties
collection, I just assumed that PPT objects would have the same collection .


No, afraid not Dale. Gotta do it the hard way. Ways really ... OLE Controls
on a slide are more like the form objects you're familiar with from Access, but
the other shapes are quite different and there's no properties collection.




If I write:

Dim prop As Property
Set obj = Forms("frm_Splash").cbo_Slide
On Error Resume Next
For Each prop In obj.Properties
Debug.Print prop.Name, prop.Type, prop.Value
Next

Then I'll get a list of 50 or so properties (see a partial list below) that
belong to that combo box. By restricting my search to those properties with
Type=8 (text), I can quickly search through all of the properties, and
capture the control, the property, and the value associated with that text
property. Since PPT does not seem to have this functionality. I'm going to
have to identify all of the various object types, then search to see what
properties they have and check for those properties individually. This will
involve a huge amount of additional reseearch and coding.

EventProcPrefix 8 cbo_Slide
Name 8 cbo_Slide
ControlType 2 111
ControlSource 8
Format 8
ConditionalFormat 8209 Null
DecimalPlaces 2 255
InputMask 8
RowSourceType 8 Table/Query
RowSource 8 qry_frm_Splash_cbo_Slide_Num
ColumnCount 2 1
ColumnHeads 11 False
ColumnWidths 8
BoundColumn 3 1
ListRows 2 8
ListWidth 8 0
StatusBarText 8
LimitToList 11 False
AutoExpand 11 True
DefaultValue 8
IMEHold 11 False
IMEMode 2 0
IMESentenceMode 2 3
ValidationRule 8
ValidationText 8
Visible 11 True
DisplayWhen 2 0
Enabled 11 True
Locked 11 False
AllowAutoCorrect 11 True
TabStop 11 True
TabIndex 2 5
Left 2 8880
Top 2 1140
Width 2 1920
Height 2 259
BackStyle 2 1
BackColor 3 16777215
SpecialEffect 2 2

"Steve Rindsberg" wrote in message
...
I'm not clear on what you're after.

If you want to list the properties of a selected shape you can:

With ActiveWindow.Selection.ShapeRange(1)
' List the properties you want:
Debug.Print .Left
Debug.Print .Top
' etc
End With

But you have to know what properties you want in advance. There's no
collection of properties you can iterate through.

In article , Dale Fye wrote:
I would like to list the properties that apply to shapes of various
types.
Specifically, I'm looking for those properties that might contain text.

As an example, the other day, I found out that I could create screen tips
that show up when I mouse over a shape.

Is there a way to do something like

Dim prop as property

'What I would like to do here is be able to select a shape in the active
presentation, then run a macro that uses the selected shape
'I still have not figured out how to do that part, so I generally do
something like the following line and iterate through the shape numbers
till
I get the one I'm looking for.

set oShp = activewindow.presentations.slides(x).shapes(y)
oShp.Select

debug.print oShp.Name, oShp.Type
For each prop in oshp.properties
debug.print prop.name, prop.value
next


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================

  #5  
Old March 25th, 2008, 05:11 AM posted to microsoft.public.office.developer.vba,microsoft.public.powerpoint,microsoft.public.office.developer.automation
Dale Fye
external usenet poster
 
Posts: 2,651
Default list properties that belong to a shape


thanks, Steve.

"Steve Rindsberg" wrote in message
...
Thanks for your responses, to this and my other questions. They have
been
very helpful.

Basically, I'm looking for a way to loop through a PPT presentation, and
identify every text string that could be embedded in the presentation
(whether it is visible to the viewer or not). I'm looking for text that
is
in textboxes, captions, lists, control tips, alternate text, default
values,
....

In Access, my Office application of choice, each object has a properties
collection, I just assumed that PPT objects would have the same
collection .


No, afraid not Dale. Gotta do it the hard way. Ways really ... OLE
Controls
on a slide are more like the form objects you're familiar with from
Access, but
the other shapes are quite different and there's no properties collection.




If I write:

Dim prop As Property
Set obj = Forms("frm_Splash").cbo_Slide
On Error Resume Next
For Each prop In obj.Properties
Debug.Print prop.Name, prop.Type, prop.Value
Next

Then I'll get a list of 50 or so properties (see a partial list below)
that
belong to that combo box. By restricting my search to those properties
with
Type=8 (text), I can quickly search through all of the properties, and
capture the control, the property, and the value associated with that
text
property. Since PPT does not seem to have this functionality. I'm going
to
have to identify all of the various object types, then search to see what
properties they have and check for those properties individually. This
will
involve a huge amount of additional reseearch and coding.

EventProcPrefix 8 cbo_Slide
Name 8 cbo_Slide
ControlType 2 111
ControlSource 8
Format 8
ConditionalFormat 8209 Null
DecimalPlaces 2 255
InputMask 8
RowSourceType 8 Table/Query
RowSource 8 qry_frm_Splash_cbo_Slide_Num
ColumnCount 2 1
ColumnHeads 11 False
ColumnWidths 8
BoundColumn 3 1
ListRows 2 8
ListWidth 8 0
StatusBarText 8
LimitToList 11 False
AutoExpand 11 True
DefaultValue 8
IMEHold 11 False
IMEMode 2 0
IMESentenceMode 2 3
ValidationRule 8
ValidationText 8
Visible 11 True
DisplayWhen 2 0
Enabled 11 True
Locked 11 False
AllowAutoCorrect 11 True
TabStop 11 True
TabIndex 2 5
Left 2 8880
Top 2 1140
Width 2 1920
Height 2 259
BackStyle 2 1
BackColor 3 16777215
SpecialEffect 2 2

"Steve Rindsberg" wrote in message
...
I'm not clear on what you're after.

If you want to list the properties of a selected shape you can:

With ActiveWindow.Selection.ShapeRange(1)
' List the properties you want:
Debug.Print .Left
Debug.Print .Top
' etc
End With

But you have to know what properties you want in advance. There's no
collection of properties you can iterate through.

In article , Dale Fye wrote:
I would like to list the properties that apply to shapes of various
types.
Specifically, I'm looking for those properties that might contain
text.

As an example, the other day, I found out that I could create screen
tips
that show up when I mouse over a shape.

Is there a way to do something like

Dim prop as property

'What I would like to do here is be able to select a shape in the
active
presentation, then run a macro that uses the selected shape
'I still have not figured out how to do that part, so I generally do
something like the following line and iterate through the shape
numbers
till
I get the one I'm looking for.

set oShp = activewindow.presentations.slides(x).shapes(y)
oShp.Select

debug.print oShp.Name, oShp.Type
For each prop in oshp.properties
debug.print prop.name, prop.value
next


--
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================



--
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 07:13 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.