From: Aleksandrs Tihonovs |
|
Hi there,
I using TWebBrowser control in my form, but I have some probs with it.
After loading html document in the browser, I handle OnDocumentComplete
event to modify the document.
But when I try change HTML an OLEexception raise up. What is wrong?
I dont know how, but it worked at the begining.
procedure TForm1.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
var Doc: IHTMLDocument2;
Obj: IHTMLElement;
begin
Doc := webbrowser1.document as IHTMLDocument2;
Obj := Doc.all.item('tabledata',0) as IHTMLElement;
Obj.innerHTML := 'Test'; --> OLEException raise here.
end;
|