@JosephP
Thanks for the reply, that is what I was looking for, found it slightly before you got back to me. Oddly I didn't get an email saying you replied so I'll make sure to check back in a bit.
My next step, now that I am controlling IE is to open an XPS document (which I can do), then to search the XPS document. I am trying to use the inStr function to search it but unfortunately I can't seem to figure out what the document itself should be referred to.
So:
inStr(1,Active Document, "test")
"Active Document" could be replaced with innerHTML but its not a website so I don't think there is HTML. I tried using innerText but that doesn't seem to work (it doesn't validate that the word "test" is present in the document, which it is).
My full code is:
Sub Button1_Click()
Dim ie As InternetExplorer
Dim ToFind As String
Set ie = New InternetExplorer
'####Search for Web Page####
ie.Navigate "C:\Documents and Settings\joseph.korn\Desktop\testxps.xps"
ie.Visible = True
ToFind = "test"
findtext = InStr(1, innerText, ToFind)
MsgBox findtext
Set ie = Nothing
End Sub
I would expect the msg box at the end to contain the position of the "ToFind" string but it keeps coming back 0. I tried outerText and no luck there either.
Would greatly appreciate any suggestions you may have.
RugbyKorn
Bookmarks