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 2008

Tip: Looking for answers? Try searching our database.

changing slides

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Bill    DaTutor - 01 Feb 2008 19:30 GMT
I calculate data for 7 days and I have a different slide for each day. I
tried to use
 ... .Slides(i).Select but this is only good for the slide info for the 7
slides..

How do I activate or show a different slide for the data for each day?
David M. Marcovitz - 01 Feb 2008 19:37 GMT
Are you just trying to jump to different slides? Are you trying to do this
in Normal View or Slide Show View?
--David

Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?QmlsbCAgICBEYVR1dG9y?= <Bill  
DaTutor@discussions.microsoft.com> wrote in
news:E0D95F21-963A-45E2-8D23-DB0EBE100AEC@microsoft.com:

> I calculate data for 7 days and I have a different slide for each day.
> I tried to use
[quoted text clipped - 3 lines]
>
> How do I activate or show a different slide for the data for each day?
Bill    DaTutor - 05 Feb 2008 13:26 GMT
I am in normal view and I want to run a macro to read an input file and then
draw boxes and lines on differeent slides depending on the day the simulation
is running.

> Are you just trying to jump to different slides? Are you trying to do this
> in Normal View or Slide Show View?
[quoted text clipped - 7 lines]
> >
> > How do I activate or show a different slide for the data for each day?
David M. Marcovitz - 05 Feb 2008 14:49 GMT
I'm still not entirely sure what you want to do, and I'm not sure why
you need to go to the slide. The following will go to a different slide
based on the day of the week:

Sub GotoDayOfWeek()
   Select Case Weekday(Date)
       Case 1
           ActivePresentation.Slides(2).Select
       Case 2
           ActivePresentation.Slides(3).Select
       Case 3
           ActivePresentation.Slides(4).Select
       Case 4
           ActivePresentation.Slides(5).Select
       Case 5
           ActivePresentation.Slides(6).Select
       Case 6
           ActivePresentation.Slides(7).Select
       Case 7
           ActivePresentation.Slides(8).Select
   End Select
End Sub

However, instead of the ActivePresentation.Slides(#).Select, why don't
you just use the number to draw your shapes, such as:

ActivePresentation.Slides(#).Shapes.AddTextbox ...

--David

Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?QmlsbCAgICBEYVR1dG9y?= <BillDaTutor@discussions.microsoft.com>
wrote in news:65D1E103-29C5-4A18-8E04-7D958A6ECA68@microsoft.com:

> I am in normal view and I want to run a macro to read an input file
> and then draw boxes and lines on differeent slides depending on the
[quoted text clipped - 12 lines]
>> > How do I activate or show a different slide for the data for each
>> > day?
Bill    DaTutor - 05 Feb 2008 16:24 GMT
I tried :
ActivePresentation.Slides(Slide_Num).Shapes. _
   AddShape(msoShapeRectangle, Left, vertical, Time, 7#).Select

where Slide_Num is defined in the main loop and has scope over all the module.
It prints all the objects for day 1 but for the first input of day 2 it
stops.  If I press Debug, it goes to the above line and Slide_Num has a value
of 2 but I get the following error message:
          Shape(unknown member): Invalid request.  To select ashape, its
view must be active.

I am using PowerPoint 2000.   Thanks for your time.

 

> I'm still not entirely sure what you want to do, and I'm not sure why
> you need to go to the slide. The following will go to a different slide
[quoted text clipped - 42 lines]
> >> > How do I activate or show a different slide for the data for each
> >> > day?
David M. Marcovitz - 05 Feb 2008 18:45 GMT
What happens if you leave off the parentheses for AddShape and cut out
.Select?
--David

Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?QmlsbCAgICBEYVR1dG9y?= <BillDaTutor@discussions.microsoft.com>
wrote in news:DDF89308-E5A5-45DB-8BAC-FDDD1C2DDE6F@microsoft.com:

> I tried :
> ActivePresentation.Slides(Slide_Num).Shapes. _
[quoted text clipped - 58 lines]
>> >> > How do I activate or show a different slide for the data for
>> >> > each day?
Steve Rindsberg - 05 Feb 2008 21:05 GMT
> I tried :
> ActivePresentation.Slides(Slide_Num).Shapes. _
[quoted text clipped - 6 lines]
>            Shape(unknown member): Invalid request.  To select ashape, its
> view must be active.

You need to go to slide 2 first, or as David suggests, don't try to Select the
shape.  There's hardly ever any real reason to do so.

> I am using PowerPoint 2000.   Thanks for your time.
>
[quoted text clipped - 46 lines]
> > >> > How do I activate or show a different slide for the data for each
> > >> > day?

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
Bill    DaTutor - 06 Feb 2008 16:21 GMT
Thanks it did work without the parenthesis (but that is how it is in the help
file)
I still have a problem though because it is now nnot selected so I can not
change nay of its properties.  How do I make it selected.  Please and Thank
you.

> In article <DDF89308-E5A5-45DB-8BAC-FDDD1C2DDE6F@microsoft.com>,

Bill    DaTutor
> wrote:
> > I tried :
[quoted text clipped - 67 lines]
> PPTools:  www.pptools.com
> ================================================
David M. Marcovitz - 06 Feb 2008 17:51 GMT
Yes, the parentheses issue is a weird one. When you put parentheses
around the parameters of a function, VBA is expecting the function to
return a value. When you leave off the parentheses, no value is
returned. Thus, when you add a shape with the parentheses, you need to
return some kind of value. You could do something like:

Dim oShp As Shape

Set oShp = ActivePresentation.Slides(#).Shapes.AddTextbox(...)

Then, you can do whatever you want with the shape by using oShp... For
example, oShp.TextFrame.TextRange.Text = "Hello"

--David

Signature

David M. Marcovitz
Microsoft PowerPoint MVP
Author of _Powerful PowerPoint for Educators_
http://www.PowerfulPowerPoint.com/

=?Utf-8?B?QmlsbCAgICBEYVR1dG9y?= <BillDaTutor@discussions.microsoft.com>
wrote in news:349727A7-1C9F-48BD-BB14-116040E787B5@microsoft.com:

> Thanks it did work without the parenthesis (but that is how it is in
> the help file)
[quoted text clipped - 78 lines]
>> PPTools:  www.pptools.com
>> ================================================
Bill    DaTutor - 06 Feb 2008 18:31 GMT
You hit it on the head .  Many Thanks,  I will drink a beer to your health.

> Thanks it did work without the parenthesis (but that is how it is in the help
> file)
[quoted text clipped - 76 lines]
> > PPTools:  www.pptools.com
> > ================================================
Steve Rindsberg - 06 Feb 2008 20:12 GMT
> Thanks it did work without the parenthesis (but that is how it is in the help
> file)
> I still have a problem though because it is now nnot selected so I can not
> change nay of its properties.  How do I make it selected.  Please and Thank
> you.

Better not to select it at all:

Dim oSh as Shape

Set oSh = ActivePresentation.Slides(Slide_Num).Shapes. _
 AddShape(msoShapeRectangle, Left, vertical, Time, 7#)
 
With oSh
  ' set properties
  .Left = 0
  .Top = 0
End With
 

> > > where Slide_Num is defined in the main loop and has scope over all the module.
> > > It prints all the objects for day 1 but for the first input of day 2 it
[quoted text clipped - 62 lines]
> > PPTools:  www.pptools.com
> > ================================================

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ:  www.pptfaq.com
PPTools:  www.pptools.com
================================================
 
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.