PeterdeB
asked on
How to copy the URL in the IE Address bar into an Tedit on my form?
Hi guys!
The title is quite selfexplanatory I guess. Just want to copy the URL in the IE Address bar into a TEdit on my form preferrably by a button click. Further more I want to grab text from a webpage which I normally can only view by right clicking > view source. How can I grab that text and put it into a TMemo on my form?
Two questions therefore I double the reward for working samples on both!
Regards from Holland,
Let me know if any info is missing ok?
PeterdeB
The title is quite selfexplanatory I guess. Just want to copy the URL in the IE Address bar into a TEdit on my form preferrably by a button click. Further more I want to grab text from a webpage which I normally can only view by right clicking > view source. How can I grab that text and put it into a TMemo on my form?
Two questions therefore I double the reward for working samples on both!
Regards from Holland,
Let me know if any info is missing ok?
PeterdeB
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
...get the HTML Code out of all Internet Explorer Instances?
http://www.swissdelphicenter.ch/en/printcode.php?id=1615
http://www.swissdelphicenter.ch/en/printcode.php?id=1615
Attention! you get the document source ( the HTML ) and not displayed text. Your Memo can't read the code as a browser. If you wish to diplay as IE then use a TWebBrowser or better EnbeddedWB from my first link.
ASKER
Splendid ginsonic!!!
Regards from Holland,
PeterdeB
Regards from Holland,
PeterdeB
Glad to can help :)
Regards from Romania,
Nick aka ginsonic
Regards from Romania,
Nick aka ginsonic
uses
shdocvw_tlb;
procedure TForm1.Button1Click(Sender
var
Sw: IShellWindows;
begin
sw := CoShellWindows.Create;
Edit1.Text:=(Sw.Item(0) as IWebbrowser2).LocationUrl;
end;