PC Review


Reply
Thread Tools Rate Thread

Reference an activex control

 
 
=?Utf-8?B?UGV0ZXJN?=
Guest
Posts: n/a
 
      26th Apr 2007
Hi .
If I have a label on a slide how can i reference it in vba.
Eg an oval on a slide rotates how do i get the label to give its rotation?

 
Reply With Quote
 
 
 
 
David M. Marcovitz
Guest
Posts: n/a
 
      26th Apr 2007
Items from the control toolbox are referenced in VBA via their slide
numbers. For example, the first label you add to slide 7 will be
referenced via Slide7.Label1

The content of the label is the Caption. You can change teh caption with
Slide7.Label1.Caption = "Whatever you want"

Next, you need to get the rotation of your Oval, which can be done
something like this:

Slide7.Label1.Caption = ActivePresentation.Slides(7).Shapes(2).Rotation

assuming that your oval is shape #2 on slide 7.

--David
--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):

> Hi .
> If I have a label on a slide how can i reference it in vba.
> Eg an oval on a slide rotates how do i get the label to give its
> rotation?
>
>


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXJN?=
Guest
Posts: n/a
 
      26th Apr 2007
Thank you very much David thats what I needed.
cheers


"David M. Marcovitz" wrote:

> Items from the control toolbox are referenced in VBA via their slide
> numbers. For example, the first label you add to slide 7 will be
> referenced via Slide7.Label1
>
> The content of the label is the Caption. You can change teh caption with
> Slide7.Label1.Caption = "Whatever you want"
>
> Next, you need to get the rotation of your Oval, which can be done
> something like this:
>
> Slide7.Label1.Caption = ActivePresentation.Slides(7).Shapes(2).Rotation
>
> assuming that your oval is shape #2 on slide 7.
>
> --David
> --
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Director of Graduate Programs in Educational Technology
> Loyola College in Maryland
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
> news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):
>
> > Hi .
> > If I have a label on a slide how can i reference it in vba.
> > Eg an oval on a slide rotates how do i get the label to give its
> > rotation?
> >
> >

>
>

 
Reply With Quote
 
=?Utf-8?B?UGV0ZXJN?=
Guest
Posts: n/a
 
      26th Apr 2007
Sorry David I just tried it and it only showed 0 is there away to have it
update say with the degrees of rotation.
Cheers

"PeterM" wrote:

> Thank you very much David thats what I needed.
> cheers
>
>
> "David M. Marcovitz" wrote:
>
> > Items from the control toolbox are referenced in VBA via their slide
> > numbers. For example, the first label you add to slide 7 will be
> > referenced via Slide7.Label1
> >
> > The content of the label is the Caption. You can change teh caption with
> > Slide7.Label1.Caption = "Whatever you want"
> >
> > Next, you need to get the rotation of your Oval, which can be done
> > something like this:
> >
> > Slide7.Label1.Caption = ActivePresentation.Slides(7).Shapes(2).Rotation
> >
> > assuming that your oval is shape #2 on slide 7.
> >
> > --David
> > --
> > David M. Marcovitz
> > Microsoft PowerPoint MVP
> > Director of Graduate Programs in Educational Technology
> > Loyola College in Maryland
> > Author of _Powerful PowerPoint for Educators_
> > http://www.PowerfulPowerPoint.com/
> >
> > =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
> > news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):
> >
> > > Hi .
> > > If I have a label on a slide how can i reference it in vba.
> > > Eg an oval on a slide rotates how do i get the label to give its
> > > rotation?
> > >
> > >

> >
> >

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      27th Apr 2007
You're probably referencing the wrong shape, or your not running the
macro after the shape has been adjusted. For example, if your shape is
not the #2 shape, then Shapes(2) won't give you the right rotation. You
might want to give the shape a name and use that instead of the number
(see Example 8.7 on my site for naming shapes).

The other issue I mentioned was running the macro. Note the macros don't
necessarily run themselves so you have to figure out when you want to
trigger the macro to update the label.

--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
news:0C32AFF5-7063-43D9-B4B8-(E-Mail Removed):

> Sorry David I just tried it and it only showed 0 is there away to have
> it update say with the degrees of rotation.
> Cheers
>
> "PeterM" wrote:
>
>> Thank you very much David thats what I needed.
>> cheers
>>
>>
>> "David M. Marcovitz" wrote:
>>
>> > Items from the control toolbox are referenced in VBA via their
>> > slide numbers. For example, the first label you add to slide 7 will
>> > be referenced via Slide7.Label1
>> >
>> > The content of the label is the Caption. You can change teh caption
>> > with Slide7.Label1.Caption = "Whatever you want"
>> >
>> > Next, you need to get the rotation of your Oval, which can be done
>> > something like this:
>> >
>> > Slide7.Label1.Caption =
>> > ActivePresentation.Slides(7).Shapes(2).Rotation
>> >
>> > assuming that your oval is shape #2 on slide 7.
>> >
>> > --David
>> > --
>> > David M. Marcovitz
>> > Microsoft PowerPoint MVP
>> > Director of Graduate Programs in Educational Technology
>> > Loyola College in Maryland
>> > Author of _Powerful PowerPoint for Educators_
>> > http://www.PowerfulPowerPoint.com/
>> >
>> > =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
>> > news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):
>> >
>> > > Hi .
>> > > If I have a label on a slide how can i reference it in vba.
>> > > Eg an oval on a slide rotates how do i get the label to give its
>> > > rotation?
>> > >
>> > >
>> >
>> >

>


 
Reply With Quote
 
=?Utf-8?B?UGV0ZXJN?=
Guest
Posts: n/a
 
      27th Apr 2007
Hi David,
The shape is correct.
If I stop the slideshow and change it's rotation it is correct.
I am not sure how to write the macro to update whilst the show is running.
or if it is possible.
Cheers

"David M. Marcovitz" wrote:

> You're probably referencing the wrong shape, or your not running the
> macro after the shape has been adjusted. For example, if your shape is
> not the #2 shape, then Shapes(2) won't give you the right rotation. You
> might want to give the shape a name and use that instead of the number
> (see Example 8.7 on my site for naming shapes).
>
> The other issue I mentioned was running the macro. Note the macros don't
> necessarily run themselves so you have to figure out when you want to
> trigger the macro to update the label.
>
> --David
>
> --
> David M. Marcovitz
> Microsoft PowerPoint MVP
> Director of Graduate Programs in Educational Technology
> Loyola College in Maryland
> Author of _Powerful PowerPoint for Educators_
> http://www.PowerfulPowerPoint.com/
>
> =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
> news:0C32AFF5-7063-43D9-B4B8-(E-Mail Removed):
>
> > Sorry David I just tried it and it only showed 0 is there away to have
> > it update say with the degrees of rotation.
> > Cheers
> >
> > "PeterM" wrote:
> >
> >> Thank you very much David thats what I needed.
> >> cheers
> >>
> >>
> >> "David M. Marcovitz" wrote:
> >>
> >> > Items from the control toolbox are referenced in VBA via their
> >> > slide numbers. For example, the first label you add to slide 7 will
> >> > be referenced via Slide7.Label1
> >> >
> >> > The content of the label is the Caption. You can change teh caption
> >> > with Slide7.Label1.Caption = "Whatever you want"
> >> >
> >> > Next, you need to get the rotation of your Oval, which can be done
> >> > something like this:
> >> >
> >> > Slide7.Label1.Caption =
> >> > ActivePresentation.Slides(7).Shapes(2).Rotation
> >> >
> >> > assuming that your oval is shape #2 on slide 7.
> >> >
> >> > --David
> >> > --
> >> > David M. Marcovitz
> >> > Microsoft PowerPoint MVP
> >> > Director of Graduate Programs in Educational Technology
> >> > Loyola College in Maryland
> >> > Author of _Powerful PowerPoint for Educators_
> >> > http://www.PowerfulPowerPoint.com/
> >> >
> >> > =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
> >> > news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):
> >> >
> >> > > Hi .
> >> > > If I have a label on a slide how can i reference it in vba.
> >> > > Eg an oval on a slide rotates how do i get the label to give its
> >> > > rotation?
> >> > >
> >> > >
> >> >
> >> >

> >

>
>

 
Reply With Quote
 
David M. Marcovitz
Guest
Posts: n/a
 
      27th Apr 2007
How are you rotating the shape during the slide show? Do you have a macro
that does that? Or I am misunderstanding what you are doing?
--David

--
David M. Marcovitz
Microsoft PowerPoint MVP
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
news:1EC5AA0A-6891-4C2E-A871-(E-Mail Removed):

> Hi David,
> The shape is correct.
> If I stop the slideshow and change it's rotation it is correct.
> I am not sure how to write the macro to update whilst the show is
> running. or if it is possible.
> Cheers
>
> "David M. Marcovitz" wrote:
>
>> You're probably referencing the wrong shape, or your not running the
>> macro after the shape has been adjusted. For example, if your shape
>> is not the #2 shape, then Shapes(2) won't give you the right
>> rotation. You might want to give the shape a name and use that
>> instead of the number (see Example 8.7 on my site for naming shapes).
>>
>> The other issue I mentioned was running the macro. Note the macros
>> don't necessarily run themselves so you have to figure out when you
>> want to trigger the macro to update the label.
>>
>> --David
>>
>> --
>> David M. Marcovitz
>> Microsoft PowerPoint MVP
>> Director of Graduate Programs in Educational Technology
>> Loyola College in Maryland
>> Author of _Powerful PowerPoint for Educators_
>> http://www.PowerfulPowerPoint.com/
>>
>> =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
>> news:0C32AFF5-7063-43D9-B4B8-(E-Mail Removed):
>>
>> > Sorry David I just tried it and it only showed 0 is there away to
>> > have it update say with the degrees of rotation.
>> > Cheers
>> >
>> > "PeterM" wrote:
>> >
>> >> Thank you very much David thats what I needed.
>> >> cheers
>> >>
>> >>
>> >> "David M. Marcovitz" wrote:
>> >>
>> >> > Items from the control toolbox are referenced in VBA via their
>> >> > slide numbers. For example, the first label you add to slide 7
>> >> > will be referenced via Slide7.Label1
>> >> >
>> >> > The content of the label is the Caption. You can change teh
>> >> > caption with Slide7.Label1.Caption = "Whatever you want"
>> >> >
>> >> > Next, you need to get the rotation of your Oval, which can be
>> >> > done something like this:
>> >> >
>> >> > Slide7.Label1.Caption =
>> >> > ActivePresentation.Slides(7).Shapes(2).Rotation
>> >> >
>> >> > assuming that your oval is shape #2 on slide 7.
>> >> >
>> >> > --David
>> >> > --
>> >> > David M. Marcovitz
>> >> > Microsoft PowerPoint MVP
>> >> > Director of Graduate Programs in Educational Technology
>> >> > Loyola College in Maryland
>> >> > Author of _Powerful PowerPoint for Educators_
>> >> > http://www.PowerfulPowerPoint.com/
>> >> >
>> >> > =?Utf-8?B?UGV0ZXJN?= <(E-Mail Removed)> wrote in
>> >> > news:2D134C3B-9E21-4A0B-B144-(E-Mail Removed):
>> >> >
>> >> > > Hi .
>> >> > > If I have a label on a slide how can i reference it in vba.
>> >> > > Eg an oval on a slide rotates how do i get the label to give
>> >> > > its rotation?
>> >> > >
>> >> > >
>> >> >
>> >> >
>> >

>>
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
publish activeX combobox and other activeX control =?Utf-8?B?aXJlbmUgYw==?= Microsoft Excel Programming 0 19th Mar 2007 08:19 AM
ActiveX Control prompt "An ActiveX control on this page might be u =?Utf-8?B?UmFodWw=?= Windows Vista General Discussion 2 1st Aug 2006 05:08 PM
Reference to ActiveX control on worksheet requires full worksheet name Ian Ripsher Microsoft Excel Programming 3 25th Jun 2005 04:22 PM
Compilation failed while compling window user control which takes reference of Activex control ashish_gokhale Microsoft ASP .NET 0 5th May 2005 02:36 PM
Creating ActiveX control Within activeX Control Vinay Chopra Microsoft VC .NET 1 17th Jan 2005 04:41 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:11 AM.