frustrating
Registered User.
- Local time
- Today, 08:56
- Joined
- Oct 18, 2012
- Messages
- 68
I'm trying to code something that scans for different files and automatically opens them.
For example: 99 times out of 100, the file is going to be a pdf, so I made this code:
What I'd like to be able to do is make it so if this fails to retrieve a pdf, to then search for a jpg, tif, or zip.
Any ideas on the best solution?
For example: 99 times out of 100, the file is going to be a pdf, so I made this code:
Code:
OID = IeApp.Document.body.innerHTML
OIDLEFT = Mid(OID, InStr(1, OID, "oid") + 4, 9) 'this scans the source code for a number i use to compile a link
Sprofile = IeApp.Document.body.innerText
totheleft = Mid(Sprofile, InStr(1, Sprofile, "sdrop event") + 12)
thekey = Left(totheleft, InStr(1, totheleft, "pdf") - 2)
thelink = "Link" & thekey & ".pdf" & "?oid=" & OIDLEFT & "&filename=" & thekey & ".pdf"
removespace = Replace(thelink, " ", "")
With IeApp
IeApp.navigate removespace
End With
Any ideas on the best solution?