HtmlEditor :  Phorum 5 The fastest message board... ever.

This is the discussion forum for the HtmlEditor. See also the HtmlEditor home page, where you can download the control, and the Documentation Wiki, a collaborative project for documenting the control.

Goto Thread: PreviousNext
Goto: Forum ListMessage ListNew TopicSearchLog In
Posted by: Scott (129.230.248.---)
Date: Friday, 30-May-2008, 14:44:29

With the latest svn code, that does not use the Primary Interop, is it possible to get FindText working? I have:

public void FindText(string text)
IHTMLTxtRange txtRange = ((IHTMLBodyElement)HtmlDocument2.GetBody()).createTextRange();
bool found = false;
found = txtRange.findText(text, 0, 0);

in HtmlEditor and it throws a NullReferenceException on the txtRange.findText line. Strange exception I thought as neither txtRange nor text are null

Re: FindText
Posted by: Prabhath (
Date: Wednesday, 02-Jul-2008, 06:23:46

Hello Scott,

I am also having the same problem while doing the findText(). If you have find any solution for this then provide it.

Thanks in advance,

Re: FindText
Posted by: Tim (Moderator)
Date: Friday, 04-Jul-2008, 14:18:16

I'll have a look.


Re: FindText
Posted by: Tim (Moderator)
Date: Friday, 04-Jul-2008, 15:01:38

I tried this code using the version without the primary interop assembly (which is the one that is still under development) and it worked OK.

I had to amend the interface declaration for IHTMLTxtRange. I changed temp18 to this:

[return: MarshalAs(UnmanagedType.Bool)]
bool findText(
[In, MarshalAs(UnmanagedType.BStr)]
string theString,int count,int flags

Worth a try?


Re: FindText
Posted by: Scott (129.230.248.---)
Date: Wednesday, 23-Jul-2008, 15:09:18


That works for me. Thanks

Your Name: 
Your Email: 
Spam prevention:
Please, enter the code that you see below in the input field. This is for blocking bots that try to post this form automatically.
This is a moderated forum. Your message will remain hidden until it has been approved by a moderator or administrator
This forum powered by Phorum.