Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General PowerPoint Questions / February 2006

Tip: Looking for answers? Try searching our database.

How to refer to an ActiveX control on a named slide?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
redhorse - 19 Feb 2006 03:48 GMT
Here is a simplified version of my situation.
I have a combo box called cboMyCombo on a slide whose default name of
"Slide6" was changed to "MySlide" using the following code in a macro:
ActiveWindow.View.Slide.Name = "MySlide"

In the VBA project window, under the category of "Microsoft PowerPoint
Objects", the slide is still listed as "Slide6", while in the Properties
pane, the (Name) property correctly shows the name as "MySlide".

I also have a code module with a routine that needs to access the properties
of cboMyCombo.  I have found that I can do this with the following syntax:
Slide6.cboMyCombo.<propertyName>

I would have thought that after changing the name of the slide, I could do
the following:
MySlide.cboMyCombo.<propertyName>
but that doesn't work.

Is there some way in code that I can refer to ActiveX objects on a renamed
slide using the new name?  I can access autoshapes with the following:
ActivePresentation.Slides("MySlide").Shapes("MyShape").<propertyName>...
but I cannot find a similar syntax for ActiveX controls.

Does anyone have any idea how I can use my own more meaningful name in code
rather than the default "Slide6"?
Shyam Pillai - 19 Feb 2006 04:03 GMT
Check out this page:
Reference an ActiveX control on a slide in VBA
http://skp.mvps.org/ppt00042.htm

When you refer to the shape in this fashion -
Slide6.cboMyCombo.<propertyName> - you are qualifying the shape with the
parent objects. Slide6 is a slide object and the Name is a property of the
slide hence even after you rename the slide you cannot use that as a object
reference.

Signature

Handout Wizard
http://skp.mvps.org/how

> Here is a simplified version of my situation.
> I have a combo box called cboMyCombo on a slide whose default name of
[quoted text clipped - 23 lines]
> code
> rather than the default "Slide6"?
redhorse - 19 Feb 2006 05:19 GMT
Shyam,

Thank you very much!  This is exactly what I needed.  I have visited your
website many times before.  I don't know how I missed this.

I got it to work as:
ActivePresentation.Slides("MySlide").Shapes("cboMyCombo").OLEFormat.Object.<propertyName>

It is not as clean as it would be if PowerPoint would allow us to actually
rename the slide object, but this will work.

> Check out this page:
> Reference an ActiveX control on a slide in VBA
[quoted text clipped - 33 lines]
> > code
> > rather than the default "Slide6"?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.