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 / September 2004

Tip: Looking for answers? Try searching our database.

GoToSlide with name of the slide

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
onintze - 29 Sep 2004 10:33 GMT
Hi!
I want to run the "go to slide" order but using the name
of the slide instead of the index or slide number.
The thing is that I have a big amount of slides and the
number of these slides varies depending on the data
introduced by the user, so I need to find the exact slide,
with its name, to make some changes there, whatever its
slide number or index is.

Until now I have used this, with the index number:

ActiveWindow.View.gotoslide Index:=21

How can I do this using the slide name?

Thanks!
Shyam Pillai - 29 Sep 2004 13:52 GMT
Pass the name of the slide and the presentation in which to perform search
to this function and it will return the slideindex for that slide.
' ----------------------------------------------------------------------------
Sub Sample()
Dim lngIndex As Long
lngIndex = GetSlideIndexFromName("Slide1", ActivePresentation)
If lngIndex = 0 Then
   MsgBox "Could not find slide with provided name.", vbExclamation
Else
   'Perform operation here...
End If
End Sub

Function GetSlideIndexFromName(Name As String, oPres As Presentation) As
Long
Dim oSld As Slide
For Each oSld In oPres.Slides
   If oSld.Name = Name Then
       GetSlideIndexFromName = oSld.SlideIndex
       Exit Function
   End If
Next oSld
End Function
' ----------------------------------------------------------------------------

> Hi!
> I want to run the "go to slide" order but using the name
[quoted text clipped - 12 lines]
>
> Thanks!
David M. Marcovitz - 29 Sep 2004 14:46 GMT
Hey Shyam!  Is there a reason why it has to be so complicated?  Wouldn't
the following work?

   ActivePresentation.SlideShowWindow.View.GotoSlide _
       (ActivePresentation.Slides(theName).SlideIndex)

where theName is the name of the slide you want to go to.  Or is all of
your extra complexity for error checking?

--David

Signature

David M. Marcovitz, Ph.D.
Director of Graduate Programs in Educational Technology
Loyola College in Maryland
Author of _Powerful PowerPoint for Educators_
http://www.loyola.edu/education/PowerfulPowerPoint/

> Pass the name of the slide and the presentation in which to perform
> search to this function and it will return the slideindex for that
[quoted text clipped - 39 lines]
>>
>> Thanks!
Shyam Pillai - 29 Sep 2004 15:17 GMT
> where theName is the name of the slide you want to go to.  Or is all of
> your extra complexity for error checking?

Yes. I prefer to include error handling in the code.
Signature

Regards
Shyam Pillai

Image Importer Wizard: http://www.mvps.org/skp/iiw.htm

> Hey Shyam!  Is there a reason why it has to be so complicated?  Wouldn't
> the following work?
[quoted text clipped - 50 lines]
>>>
>>> Thanks!
 
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.