Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 07-23-2015, 02:28 AM
JohnWilson JohnWilson is offline User form Help Windows 7 64bit User form Help Office 2010 32bit
Programmer
 
Join Date: Nov 2008
Location: UK
Posts: 1,913
JohnWilson has a spectacular aura aboutJohnWilson has a spectacular aura about
Default

Maybe this (you could easily add the keydown sub but it's not needed. Might need a little edit to get the all found correct.

Code:
Dim SldINX As Long
Private Sub UserForm_Initialize()
Me.FCnext.Caption = "Find"
End Sub
Private Sub FCnext_Click()
If SldINX = 0 Then SldINX = 1
Me.FCnext.Caption = "Next"
Call searchSlide(SldINX)
End Sub
Sub searchSlide(fromSld As Long)
Dim oshp As Shape
Dim osld As Slide
Dim Counter As Long
Dim b_found As Boolean
If SldINX > ActivePresentation.Slides.Count Then
MsgBox "Done"
Unload UserForm1
Exit Sub
End If
For Counter = fromSld To ActivePresentation.Slides.Count
Set osld = ActivePresentation.Slides(Counter)
For Each oshp In osld.Shapes
        If oshp.HasTextFrame Then
          If oshp.TextFrame.HasText Then
            If InStr(UCase(oshp.TextFrame.TextRange), UCase(Me.TextBox1.Text)) > 0 Then
              SlideShowWindows(1).View.GotoSlide (osld.SlideIndex)
              b_found = True
               SldINX = Counter + 1
               Exit For
            End If
          End If
        End If
      Next oshp
      If b_found Then Exit For
    Next Counter
  If b_found = False Then
  SlideShowWindows(1).View.GotoSlide (ActivePresentation.Slides.Count)
   MsgBox "Not Found"
  Me.TextBox1.Text = ""
  SldINX = 1
  Unload UserForm1
  End If
End Sub
__________________
Microsoft PowerPoint MVP 2007-2023
Free Advanced PowerPoint Tips and Tutorials

Last edited by JohnWilson; 07-23-2015 at 04:30 AM.
Reply With Quote
 

Tags
userform, vba, vba powerpoint



Similar Threads
Thread Thread Starter Forum Replies Last Post
VBA to save word user form value to xml Rose roon Word VBA 25 06-23-2015 04:35 AM
User Form - Close Paragraphs SonyaEnz Word VBA 4 06-05-2015 06:16 AM
User form abdulgani Excel 0 12-15-2014 05:54 AM
User form Help User Form placasse47 Excel Programming 3 08-01-2012 05:57 AM
Controlling Style when a user pastes into a form Cris0205 Word 0 08-05-2010 04:33 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:38 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft