David,

    When I upload my program you will be able to see what I did. It uses the 
WinHttp object to get the data from the web page.
    I also show both examples for getting text and binary. Binary comes in 
handy only for streaming data right to a file in it's original form.

    I guess I could post the functions I use here to give you an idea of what 
to do for what reason, in fact my test program that is now installed in the new 
HeadLine News app.

    I also have an app that can take all your favorites folder links and 
display them in an HTML file with all the different folders displayed as a 
different section on the screen from your Desktop. That program only converts 
folder links as actual links by extracting the link data from the files.

See Below:
        Bruce
URLText Function:
This function gets either text or binary data from the web site you send in.

Function GetURL( sUrl, dataType)
 'Return data type from URL.
 Dim objHttp
 Const WinHttpRequestOption_UserAgentString = 0 'String
 Const WinHttpRequestOption_SslErrorIgnoreFlags  = 4  'Long
 Const WinHttpRequestOption_EnableRedirects = 6 'Boolean
 Const WinHttpRequestOption_EnableHttpsToHttpRedirects = 12  'Boolean
 On Error Resume Next
 Set objHttp = CreateObject( "WinHttp.WinHttpRequest.5.1")
 ' ignore all server certificate errors
 objHttp.Option( WinHttpRequestOption_SslErrorIgnoreFlags) = &H3300
 objHttp.Option( WinHttpRequestOption_EnableHttpsToHttpRedirects) = True
 'Fetch The URL Page
 objHttp.Open "GET", sUrl, False
 objHttp.Send
 'Not Busy So Get Text
 If objHttp.Status = 200 Then
  If dataType = "Binary" Then
   GetURL = objHttp.ResponseBody
  Else 'Get Text From URL
   GetURL = objHttp.ResponseText
  End If
 Else
   GetURL = ""
 End If
 Set objHttp = Nothing
End Function

Sent: Monday, February 03, 2014 2:38 PM
Subject: Re: Retrieving a link from the BrowseMode buffer


Hi, David.

Honestly, you're best bet is to get the NativeObjectModel from the IE
Window itself, and work with the HTMLWindow2 interface directly (from
this you can get the Document object, and workwith the DOM directly).
The BrowseMode interface through Window-Eyes scripting is greatly
lacking. Ican give you a snippet for getting the IHTMLWindow2 interface
if you're interested.

Thanks,

Aaron

On 2/3/2014 7:51 AM, David wrote:
> Think I got stuck here, and wonder if someone could give me a bit of
> first-aid :)
> I have the following code:
>     Dim BMBuffer: Set BMBuffer = BrowseMode
>     Dim BMLineNumber: BMLineNumber = BMBuffer.CursorLine
>     Dim BMLine: Set BMLine = BMBuffer.Lines( BMLineNumber)
> So far, things work well, and I can get it to speak the line number,
> and the text of the line. Next, I check on the IsLink boolean, to make
> sure I am on a link in the buffer. Now, how do I retrieve the actual
> link - that is, the "http" blah-blah stuff - from my finding?
> OK, I read in the reference material for WE, and find the DOMNode
> property. So, I do something like:
>  Dim BMNode: Set BMNode = BMLine.DOMNode
> If I now test on the TypeName of the BMNode variable, whenever
> focusing a link, I get the message that it is
>  Nothing,
> when I am working in Firefox, and in Internet Explorer, I get an
> object of the type
>  DispHtmlTextNode.
> Not really sure, why it would return an empty object, when in Firefox,
> but recognize things well enough in Internet Explorer. Well, computers
> have their own kind of fun.
> Anyway, my real trouble here is, how can I make the app tell me the
> actual "http" stuff for the focused Link, when in BrowseMode? What is
> the correct syntax here? Any ideas are welcome. Thanks all of you...

--
Aaron Smith
Web Development * App Development * Product Support Specialist
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com

To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.


---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com

Reply via email to