Advertisement

08.19.2008 at 11:53PM PDT, ID: 23662186 | Points: 500
[x]
Attachment Details

Unable to get the selected text from the OLE browser

Asked by shore-support in PowerBuilder Programming Language, Internet Explorer Web Browser, Windows OLE Programming

Tags: ,

We are using OLE browser in PowerBuilder to let the user select important sections from the displayed html file in OLE Browser. After user selects the important text, we use the code (attached ) to get the text selected.

For the html file(we displayed the local copy of "http://www.biogenidec.com/site/news-and-media.html?pr_id=../news/BiogenIDECPR_2008_27.htm" file in the ole browser), we are getting empty string when we selected the text "The reconciling items between the GAAP diluted EPS and non-GAAP diluted EPS for full year 2008 are itemized in Table 3 within this press release" from the attached html document. When we tried to get the outerhtml, we got only the skeleton html text. For other files, there is no problem.




Start Free Trial
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
// Code to get the text selected by the user.
selctedtext = ole_browser.object.document.selection.createRange().htmltext
 
string lcHtml,lcNew
 
// Check the ready state of the browser. Else the //ole_browser.object.Document might not be available as the browser
// runs in the different thread
DO WHILE  ole_browser.object.ReadyState <> 4	
  Sleep(100)
loop
 
//Try to get the html text of entire html document.
 lcHtml = ole_browser.object.Document.DocumentElement.outerhtml
[+][-]08.22.2008 at 09:51AM PDT, ID: 22291833

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]09.09.2008 at 03:16AM PDT, ID: 22425709

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628