OLE support for Internet Explorer in Win XP

Help
2010-06-26
2012-08-14
  • Per Olov Jonsson

    I am trying to use the IE to find documents and download them from the
    internet in an OoRexx Program. I can start the IE and navigate to a specific
    page and find out the details of it if it is in HTML but I can not print a
    page or download a page. Also I can not do the same for PDF pages or images
    and I am kind of stuck. I have used the example to create the vital code and I
    have used OleInfo and MethInfo example programs but no luck. This is what I
    have:

    url='http://www.epo.org'

    / instantiate an instance of the Internet Explorer /

    myExplorer = .OLEObject~New("InternetExplorer.Application")

    myExplorer~Navigate(url)

    / wait for browser to load the page /

    DO WHILE myExplorer~Busy = .True

    CALL sysSleep 0.20

    END

    / get the new page /

    doc = myExplorer~document

    body = doc~body -- get BODY

    textrange = body~CreateTextRange -- get TextRange

    text = textrange~Text -- get the contents

    Works fine but how do I print or save to a file? For this PDF I get error
    messages (~type=Adobe PDF)

    url='https://data.epo.org/publication-server/pdf-document?PN=EP2198683%20EP%2
    02198683&iDocId=7342035&iepatch=.pdf
    '

    I can really need some firm advice here. Ideas on how to milk the objects from
    Windows of their existing methods are warmly welcome. What I need the most is
    some kind o ~Saveas() or ~Printout()

     
  • Brandon Cherry

    Brandon Cherry - 2010-07-06

    I do not think you can do it this way. Trying it with the pdf myself, I get an
    error on the line "doc = myExplorer~document". Looking at the msdn I found
    this:

    "If the document object type is not marked safe for scripting, this property
    returns Nothing. For more information, see Safe Initialization and Scripting
    for ActiveX Controls."

    Reference:

    http://msdn.microsoft.com/en-
    us/library/aa752052(v=VS.85).aspx

     
  • Per Olov Jonsson

    Hello bwcherry and thanks for the info, I just forgot to post my repsonse,
    sorry. I think you are right in that it can not be done this way.

    This item can be closed.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks