Pozdravljeni,
Na prvi strani PP predstavitve bi rad imel nekakšen serch bar, preko katere bi v predstavitvi poiskal določeno kodo izdelka..se pravi vpišem 00123 in me vrže na slide kjer je ta koda.
S pomočjo googla sem spackal tole (kodo sem dodelil kontrolniku Polje s besedilom), vendar vse kar vpišem napiše, da ne najde nič. Prosim za pomoč, bi mi olajšalo in skrajšalo delo, hvala. Lp
Dim osld As Slide
Dim oshp As Shape
Dim b_found As Boolean
If KeyCode = 13 Then 'ENTER PRESSED
If Me.TextBox1.Text <> "" Then
For Each osld In ActivePresentation.Slides
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)
Me.TextBox1.Text = ""
b_found = True
Exit For
End If
End If
End If
Next oshp
if b_found=True Then Exit For
Next osld
End If
If b_found = False Then MsgBox "Not found"
End If
PwerPoint in search bar
Re: PwerPoint in search bar
S samo kodo ni popolnoma nič narobe... Vezati pa jo seveda morate na KeyDown dogodek vašega vnosnega polja in potem deluje natanko tako kot pričakujete - po vseh diapozitivih išče vneseno besedilo in če ga najde prikaže diapozitiv na katerem ga je našel, sicer izpiše 'Not found'
Koda: Izberi vse
Private Sub TextBox1_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Dim osld As Slide
Dim oshp As Shape
Dim b_found As Boolean
If KeyCode = 13 Then 'ENTER PRESSED
If Me.TextBox1.Text <> "" Then
For Each osld In ActivePresentation.Slides
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)
Me.TextBox1.Text = ""
b_found = True
Exit For
End If
End If
End If
Next oshp
If b_found = True Then Exit For
Next osld
End If
If b_found = False Then MsgBox "Not found"
End If
End Sub
lp,
Matjaž Prtenjak
Administrator
Matjaž Prtenjak
Administrator
Re: PwerPoint in search bar
Dlžan gajbo..česarkoli
res hvala.
Lp,

Lp,