Your little function didn't work. I think your command syntax's are incorrect.
I searched around google for a little while and came accross this.
uses ActiveX;
...
procedure WB_SaveAs_HTML(WB:TWebBrowser; const FileName : string);
var
PersistStream: IPersistStreamInit;
Stream: IStream;
FileStream: TFileStream;
begin
if not Assigned(WB.Document) then
begin
ShowMessage('Document not loaded!');
Exit;
end;
PersistStream := WB.Document as IPersistStreamInit;
FileStream := TFileStream.Create(FileName, fmCreate);
try
Stream := TStreamAdapter.Create(FileStream, soReference)
as IStream;
if Failed(PersistStream.Save(Stream, True)) then
ShowMessage('SaveAs HTML fail!');
finally
FileStream.Free;
end;
end; (* WB_SaveAs_HTML *)
Works very good. I do have a question though.
The code I just supplied saves the source of the webpage to a file and then I must load it into my memo box. How can I manipulate the code I found to read it into a memo box without saving it? In other words load it in on the fly. Would I load it in as a stream? If so how?
Thanks,
The Lone Programmer
"Is The Juice Worth The Squeeze"
-The Girl Next Door