Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

IE-embedded PDFs

Status
Not open for further replies.

Cyntalan

Programmer
Jun 29, 2007
14
US
I realize that my follow-up replies really deserved their own thread instead, so ignore the posts there. The only relation to them is the history, which can be found here:


To sum it up, I have a report system that generates these reports via IE, also with options to be made into a downloadable PDF. I've been working on automating this process for printing purposes and have been quite successful. My next step is to make the PDF option also automated. This is where I'm stuck.

Unlike the printing idea, which can be set to be automatic upon form submission, to get the PDF, you must actually bring up the preview and download it manually. This is brought up by submitting the form, which then opens a new window with a summary page, along with a link to the preview. This link is a javascript command that can't be navigated to. It acts as a redirector that sends you to the location of the latest version of the report generated. From there, in a separate frame, is a link that will bring up a popup download page, that will let you select various formats. From here, you can either view the file as a preview(which brings up the file embedded in IE), or download it (which a normal IE download prompt follows).

I have found an alternative to accessing this same file, as the link to the PDF is fairly static in that the report numbers are always in the link, and most everything else is always the same. The only problem is within the link is a version number, as well as a page range(these combined make the link a little more dynamic). Normally, I would simply do a link check until I got a navigate error, only that this system, rather than throwing a nav error, gives a error prompt and redirects back to the last successful page loaded. Thus, cycling through version numbers and page ranges are not an option (not to mention slow).

So now I have only my original option of link clicking left, back at the beginning. The javascript from that first link will provide me with the necessary information (version number, page count) to continue. But if I am able to understand how to click those links through VBA (rather than the navigate function), I would also be able to click my way to downloading without needing that information. What should I do at this point?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top