How to use FIND Function in PP VB

J

jimr

I am attempting to search the hyperlink.address property of a shape object to
determin if a particular string is present. For example, if "USPRTRY321563"
is present in
"http://webprinters.lasalle.na.abnamro.com/confirm.asp?srv=USPSTRYCUR02&name=USPRTRY321563". I have the following code:

Sub Address_Find()
FindWhat = InputBox("Enter Printer To Find", "Find Printer")

For Each s In ActivePresentation.Slides
For Each h In s.Hyperlinks
tip = h.ScreenTip
HypeAdd = h.Address ( I saved the Address to a variable, thinking maybe I
could search it...)
FoundText = h.Address.Find(FindWhat:=FindWhat)
Next
Next
If FoundText Is Nothing Then
MsgBox ("Printer not Found")
Else
MsgBox ("Printer Found")
End If
End Sub


Anyways, I receive an "object required" error on my Find statement. What
object is required and how do I find it?

Any help anyone can give would greatly be appreciated.
 
J

jimr

Steve Rindsberg said:
Same as before, I think you're trying to bludgeon .Find into doing things it won't.

There's no .Address.Find method for example.
Wouldn't this work:

If Instr(h.Address, FindWhat) > 0 Then
' whatever
End If



-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================


Thank you for your help again. As I self taught in VB and its applications to ppt and excel, I appreciate all of the assistance.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top