核心提示:procedure DoChangePageCode(Doc: IDispatch);var tr: IHTMLTxtRange; s: string;begin tr := ((Doc as IHT...
procedure DoChangePageCode(Doc: IDispatch);var
tr: IHTMLTxtRange;
s: string;
begin
tr := ((Doc as IHTMLDocument2).body as IHTMLBodyElement).createTextRange;
s := tr.htmlText; // 取出页面的代码
// 此处就能随意改了
tr.pasteHTML(s); // 改完后的代码写回去
end;