Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9019789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T04:51:37+00:00 2026-06-16T04:51:37+00:00

is it possible to save entire document loaded in Webbrowser (in Delphi) as a

  • 0

is it possible to save entire document loaded in Webbrowser (in Delphi) as a ordinary HTML file with new values (I mean values entered by user in html’s forms this document)?
I need this for reading this HTML document with all values next time when application will be used.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T04:51:38+00:00Added an answer on June 16, 2026 at 4:51 am

    Sure this is possible!

    Small demo App, make a new vcl forms application, drop a TWebBrowser, a TButton and a TMemo on your form and use this code (don’t forget to bind OnCreate for the Form and OnClick for the Button)

    interface
    
    uses
      Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
      Dialogs, OleCtrls, SHDocVw, StdCtrls,mshtml, ActiveX;
    
    type
      TForm1 = class(TForm)
        WebBrowser1: TWebBrowser;
        Button1: TButton;
        Memo1: TMemo;
        procedure FormCreate(Sender: TObject);
        procedure Button1Click(Sender: TObject);
      private
        { Private declarations }
      public
        { Public declarations }
      end;
    
    var
      Form1: TForm1;
    
    implementation
    
    {$R *.dfm}
    
    //code snagged from about.com
    procedure WBLoadHTML(WebBrowser: TWebBrowser; HTMLCode: string) ;
    var
       sl: TStringList;
       ms: TMemoryStream;
    begin
       WebBrowser.Navigate('about:blank') ;
       while WebBrowser.ReadyState < READYSTATE_INTERACTIVE do
        Application.ProcessMessages;
    
       if Assigned(WebBrowser.Document) then
       begin
         sl := TStringList.Create;
         try
           ms := TMemoryStream.Create;
           try
             sl.Text := HTMLCode;
             sl.SaveToStream(ms) ;
             ms.Seek(0, 0) ;
             (WebBrowser.Document as IPersistStreamInit).Load(TStreamAdapter.Create(ms)) ;
           finally
             ms.Free;
           end;
         finally
           sl.Free;
         end;
       end;
    end;
    
    procedure TForm1.Button1Click(Sender: TObject);
    
    var
      Doc : IHtmlDocument2;
    
    begin
     Doc := WebBrowser1.Document as IHtmlDocument2;
     Memo1.Lines.Text := Doc.body.innerHTML;
    end;
    
    procedure TForm1.FormCreate(Sender: TObject);
    
    var
      Html : String;
    begin
     Html := 'change value of input and press Button1 to changed DOM<br/><input id="myinput" type="text" value="orgval"></input>';
     WBLoadHTML(WebBrowser1, Html);
    end;
    
    end.
    

    Output:

    enter image description here

    EDIT

    As mjn pointed out, the values of password type inputs will not be shown.
    You can still can get their value though:

    add these 2 lines to Button1.Click and change html

    OnCreate:

    Html := 'change value of input and press Button1 to changed DOM<br/><input id="myinput" type="password" value="orgval"></input>';
    

    OnClick:

    El := (Doc as IHtmlDocument3).getElementById('myinput') as IHtmlInputElement;
         Memo1.Lines.Add(Format('value of password field = %s', [El.value]))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

It is possible, to save an entire process to a file, in order to
How is it possible to save text from a text field when the user
How is it possible to save a file to the android phone rather than
is it possible to save the .xml file from the screen to main.xml? my
I had a quick question. Is it possible to save a file without actually
Is it possible to save the layout diagram from a DBML file as a
How do I save an entire VB6 project to a new folder? Modules and
Is it possible to save an entire array (or even ArrayList) to the android
I am wondering if it is possible to save the entire http response on
how is it possible to save my image, created with gd, as an png-8?

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.