Re: [DUG]: Accessing page in TWebBrowser

2001-03-24 Thread Dave

Just found this code. May be what you are after. (If you haven't solved this
already)

procedure TForm1.SaveHTMLSourceToFile(const FileName: string;
  WB: TWebBrowser);
var
  PersistStream: IPersistStreamInit;
  FileStream: TFileStream;
  Stream: IStream;
  SaveResult: HRESULT;
begin
  PersistStream := WB.Document as IPersistStreamInit;
  FileStream := TFileStream.Create('c:\temp\temp.tmp', fmCreate);
  try
Stream := TStreamAdapter.Create(FileStream, soReference) as IStream;
SaveResult := PersistStream.Save(Stream, True);
if FAILED(SaveResult) then
  MessageBox(Handle, 'Fail to save HTML source', 'Error', 0);
  finally
{ we are passing soReference in TStreamAdapter constructor,
  it is our responsibility to destroy the TFileStream object. }
FileStream.Free;
  end;
end;

Dave.
- Original Message -
From: Alex Kouznetsov [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Thursday, March 01, 2001 4:49 PM
Subject: [DUG]: Accessing page in TWebBrowser


 How can I access html text of the page currently displayed in the
 TWebBrowser component ?

 Thanks
 Alex

 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of "unsubscribe delphi"


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"



Re: [DUG]: Accessing page in TWebBrowser

2001-03-24 Thread Dave

Or even better,

var
  PersistStream: IPersistStreamInit;
  MemStream: TStream ;
  OutStream: TOLEStream ;
  Stream: IStream;
  SaveResult: HRESULT;
begin
  PersistStream := WB.Document as IPersistStreamInit;
  MemStream := TMemoryStream.Create ;
  try
Stream := TStreamAdapter.Create(MemStream, soReference) as IStream;
SaveResult := PersistStream.Save(Stream, True);
OutStream := TOLEStream.Create(Stream) ;
OutStream.Position := 0 ;
Memo1.Lines.LoadFromStream(OutStream) ;
if FAILED(SaveResult) then
  MessageBox(Handle, 'Fail to save HTML source', 'Error', 0);
  finally
MemStream.Free ;
  end;
end;

Dave.
- Original Message -
From: Dave [EMAIL PROTECTED]
To: Multiple recipients of list delphi [EMAIL PROTECTED]
Sent: Sunday, March 25, 2001 11:03 AM
Subject: Re: [DUG]: Accessing page in TWebBrowser


 Just found this code. May be what you are after. (If you haven't solved
this
 already)

 procedure TForm1.SaveHTMLSourceToFile(const FileName: string;
   WB: TWebBrowser);
 var
   PersistStream: IPersistStreamInit;
   FileStream: TFileStream;
   Stream: IStream;
   SaveResult: HRESULT;
 begin
   PersistStream := WB.Document as IPersistStreamInit;
   FileStream := TFileStream.Create('c:\temp\temp.tmp', fmCreate);
   try
 Stream := TStreamAdapter.Create(FileStream, soReference) as IStream;
 SaveResult := PersistStream.Save(Stream, True);
 if FAILED(SaveResult) then
   MessageBox(Handle, 'Fail to save HTML source', 'Error', 0);
   finally
 { we are passing soReference in TStreamAdapter constructor,
   it is our responsibility to destroy the TFileStream object. }
 FileStream.Free;
   end;
 end;

 Dave.
 - Original Message -
 From: Alex Kouznetsov [EMAIL PROTECTED]
 To: Multiple recipients of list delphi [EMAIL PROTECTED]
 Sent: Thursday, March 01, 2001 4:49 PM
 Subject: [DUG]: Accessing page in TWebBrowser


  How can I access html text of the page currently displayed in the
  TWebBrowser component ?
 
  Thanks
  Alex
 

 --
 -
  New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
  To UnSub, send email to: [EMAIL PROTECTED]
  with body of "unsubscribe delphi"
 

 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of "unsubscribe delphi"


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"



RE: [DUG]: Accessing page in TWebBrowser

2001-03-01 Thread Patrick Dunford

According to the documentation with it, the Document property provides an
interface to the HTML document being displayed in the browser.

 -Original Message-
 From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
 Behalf Of Alex Kouznetsov
 Sent: Thursday, 1 March 2001 17:49
 To: Multiple recipients of list delphi
 Subject: [DUG]: Accessing page in TWebBrowser


 How can I access html text of the page currently displayed in the
 TWebBrowser component ?

 Thanks
 Alex

 --
 -
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of "unsubscribe delphi"


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"



Re: [DUG]: Accessing page in TWebBrowser

2001-03-01 Thread Alex Kouznetsov

Thanks Patrick. But do you have more specific information on how to actually
access html source ?

- Original Message -
From: "Patrick Dunford" [EMAIL PROTECTED]
To: "Multiple recipients of list delphi" [EMAIL PROTECTED]
Sent: Thursday, 1 March 2001 22:06
Subject: RE: [DUG]: Accessing page in TWebBrowser


 According to the documentation with it, the Document property provides an
 interface to the HTML document being displayed in the browser.

  -Original Message-
  From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
  Behalf Of Alex Kouznetsov
  Sent: Thursday, 1 March 2001 17:49
  To: Multiple recipients of list delphi
  Subject: [DUG]: Accessing page in TWebBrowser
 
 
  How can I access html text of the page currently displayed in the
  TWebBrowser component ?
 
  Thanks
  Alex
 
  --
  -
  New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
Website: http://www.delphi.org.nz
  To UnSub, send email to: [EMAIL PROTECTED]
  with body of "unsubscribe delphi"
 

 --
-
 New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
   Website: http://www.delphi.org.nz
 To UnSub, send email to: [EMAIL PROTECTED]
 with body of "unsubscribe delphi"


---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"



Re: [DUG]: Accessing page in TWebBrowser

2001-02-28 Thread Steve Peacocke

At 03:49 pm 1/03/01 +1100, Alex Kouznetsov said:
How can I access html text of the page currently displayed in the
TWebBrowser component ?

Thanks
Alex

The simple answer is you can't. The TWebBrowser component is not a Delphi
component but an control that gives you access to Internet Explorer in a
panel.

I tried once before to get access to the HTML but could not find a way.
Perhaps there is a way using OLE - a place I have no real desire to go.

Steve
---
New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"