Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
inet
active_desktop
active_scrptng
asp.components
asp.db
asp.general
comctl32
comp.packaging
components.dev
dbweb
dhtml_editing
docobjects
html_authoring
html_objmodel
iis
iis.ftp
iis.security
iis.smtp_nntp
indexserver
misc
mshtml_hosting
scripting.jscript
scripting.vbscript
sdk_setup
shell_objmodel
urlmonikers
webbrowser_ctl
wininet
  
 
date: Thu, 6 Oct 2005 06:11:10 -0700,    group: microsoft.public.inetsdk.programming.html_objmodel        back       


textRange object   
Hi,

Surprisingly, no one seems to have encountered this issue anywhere I've 
searched.

My problem is, while looping through a document using the textRange object, 
it appears that when it encounters the search string in text that is not 
"selectable", such as the href value in a link, or other "non-displayed" 
html, I get the following error:

Error: Could not complete the operation due to error 800a025e.

It would have been nice if there was an "isSelectable", or "innerText" 
property on the textRange object.

Any suggestions, solutions or work-a-rounds?

Thanks 

Tony
date: Thu, 6 Oct 2005 06:11:10 -0700   author:   TonyWeb

Re: textRange object   
TonyWeb  wrote:
> Surprisingly, no one seems to have encountered this issue anywhere
> I've searched.
>
> My problem is, while looping through a document using the textRange
> object, it appears that when it encounters the search string in text
> that is not "selectable", such as the href value in a link, or other
> "non-displayed" html, I get the following error:
>
> Error: Could not complete the operation due to error 800a025e.

I'm not sure I understand. In my experience, TextRange only searches the 
displayed text, it does not look inside element attributes. Can you show 
an example of what you are doing?

> It would have been nice if there was an "isSelectable", or "innerText"
> property on the textRange object.

You mean like textRange.text property?
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Thu, 6 Oct 2005 10:06:05 -0400   author:   Igor Tandetnik

Re: textRange object   
Igor,

Thank you for your response...It got me to look at the problem differently.

It turns out that the problem was DIVs with the style display set to "none". 
Guess it's kinda hard to select text thats display is being suppressed.

You where right about findText searching the displayed text only. Although, 
when I created the range from the body, ALL HTML was included in the range, 
so I assumed THAT text being searched literally. Somehow findText is smart 
enough to only search the text that the user will actually see. 

Uh, with the exception of "non-displayed" DIVs of course.

Thanks again.

Tony
date: Fri, 7 Oct 2005 04:41:01 -0700   author:   TonyWeb

Re: textRange object   
"TonyWeb"  wrote in message
news:F9BB4749-844D-4585-9C9D-590457ECD36E@microsoft.com
> It turns out that the problem was DIVs with the style display set to
> "none". Guess it's kinda hard to select text thats display is being
> suppressed.

You could call select() inside try / catch block, this way you can 
intercept any error before it reaches the user.

Another approach is to use boundingHeight and boundingWidth properties. 
I suspect, but am not sure, that they would both be 0 when TextRange is 
positioned over hiddent text.

Yet another is to use parentElement() method, then walk up the 
parentElement chain until you either reach the element with no parent 
(usually the document) or find an element with display:none style.
-- 
With best wishes,
    Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not 
necessarily a good idea. It is hard to be sure where they are going to 
land, and it could be dangerous sitting under them as they fly 
overhead. -- RFC 1925
date: Fri, 7 Oct 2005 07:51:23 -0400   author:   Igor Tandetnik

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us