Hi all
I want to programmatically save the current web page (which was loaded from an MHTML file):
I want to specify the name and location for the file to be saved and be able to specify "Save as Webpage, complete". Having Google researched, I do not believe this is possible. Can anybody prove me wrong?
The only approach I can think of is ExecWB(4,n) where n is 0, 1 or 2. If it cannot be done without user interaction, I would like that interaction to be as minimal as possible (e.g. putting the folder location in the clipboard so that the user can at least paste it into the save as dialog would help, as would being able to at least specify the file name). I can't find a way for the SaveAs dialog to default to Webpage, complete.
Many thanks
Paul Newton
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
Most things are achievable.
If no provision through the API then use windows api find window, controls on that form (hwnd), send messages to get desired results etc. etc.
A bit of work but it'll work fine. E.g. Had a look at the Firefox "Save As" dialogue just now and everything is accessible and exposed.
It'd be simply a matter of setting text in an Edit control and a ComboBox and Clicking on a Button. All done with messages.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul Newton Sent: Monday, 30 May 2022 3:12 AM To: profoxtech@leafe.com Subject: Sava as from IE application object or Web Browser control
Hi all
I want to programmatically save the current web page (which was loaded from an MHTML file):
I want to specify the name and location for the file to be saved and be able to specify "Save as Webpage, complete". Having Google researched, I do not believe this is possible. Can anybody prove me wrong?
The only approach I can think of is ExecWB(4,n) where n is 0, 1 or 2. If it cannot be done without user interaction, I would like that interaction to be as minimal as possible (e.g. putting the folder location in the clipboard so that the user can at least paste it into the save as dialog would help, as would being able to at least specify the file name). I can't find a way for the SaveAs dialog to default to Webpage, complete.
Many thanks
Paul Newton
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
[excessive quoting removed by server]
Thanks Darren
This is for what will probably be a one-off task, so probably not worth the effort. At the moment I am (i) putting the folder in the clipboard and (ii) creating an empty file with the desired name and extension. The user copies from the clipboard to get to the correct foldsr and then clicks on the already created filename. Only two problems (i) the user still has to select "Webpage, complete" and (ii) click OK on an overwrite warning message).
The "user" is me (I don't envisage anybody else using what I am doing)
Paul
On 30/05/2022 13:32, Darren wrote:
Most things are achievable.
If no provision through the API then use windows api find window, controls on that form (hwnd), send messages to get desired results etc. etc.
A bit of work but it'll work fine. E.g. Had a look at the Firefox "Save As" dialogue just now and everything is accessible and exposed.
It'd be simply a matter of setting text in an Edit control and a ComboBox and Clicking on a Button. All done with messages.
-----Original Message----- From: ProfoxTech [mailto:profoxtech-bounces@leafe.com] On Behalf Of Paul Newton Sent: Monday, 30 May 2022 3:12 AM To:profoxtech@leafe.com Subject: Sava as from IE application object or Web Browser control
Hi all
I want to programmatically save the current web page (which was loaded from an MHTML file):
I want to specify the name and location for the file to be saved and be able to specify "Save as Webpage, complete". Having Google researched, I do not believe this is possible. Can anybody prove me wrong?
The only approach I can think of is ExecWB(4,n) where n is 0, 1 or 2. If it cannot be done without user interaction, I would like that interaction to be as minimal as possible (e.g. putting the folder location in the clipboard so that the user can at least paste it into the save as dialog would help, as would being able to at least specify the file name). I can't find a way for the SaveAs dialog to default to Webpage, complete.
Many thanks
Paul Newton
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]
Paul, If you look at the Chilkat Activex page, they have a number of VFP examples of doing this, depending upon how you want to save the page.
https://www.example-code.com/csharp/mht_downloadToString.asp
You can download the trial version and temporarily unlock it to view the results.
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
Mob: 07967 671080
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd T 01706 222 792 E DCrozier@flexipol.co.uk W https://www.flexipol.co.uk/ Follow us: Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Terms & Conditions: Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time -----Original Message----- From: ProFox profox-bounces@leafe.com On Behalf Of Paul Newton Sent: 29 May 2022 18:12 To: profox@leafe.com Subject: Sava as from IE application object or Web Browser control
Hi all
I want to programmatically save the current web page (which was loaded from an MHTML file):
I want to specify the name and location for the file to be saved and be able to specify "Save as Webpage, complete". Having Google researched, I do not believe this is possible. Can anybody prove me wrong?
The only approach I can think of is ExecWB(4,n) where n is 0, 1 or 2. If it cannot be done without user interaction, I would like that interaction to be as minimal as possible (e.g. putting the folder location in the clipboard so that the user can at least paste it into the save as dialog would help, as would being able to at least specify the file name). I can't find a way for the SaveAs dialog to default to Webpage, complete.
Many thanks
Paul Newton
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html ---
[excessive quoting removed by server]
Many thanks Dave
I'll definitely take a look - sounds promising. Busy on something else right now but will let you (and the list) know how I get on.
Paul
On 30/05/2022 13:56, Dave Crozier wrote:
Paul, If you look at the Chilkat Activex page, they have a number of VFP examples of doing this, depending upon how you want to save the page.
https://www.example-code.com/csharp/mht_downloadToString.asp
You can download the trial version and temporarily unlock it to view the results.
Dave Crozier Software Development Manager Flexipol Packaging Ltd.
Mob: 07967 671080
﴾⚆ᨎ⚆﴿
Flexipol® Packaging Ltd T 01706 222 792 EDCrozier@flexipol.co.uk Whttps://www.flexipol.co.uk/ Follow us: Unit 14 Bentwood Road, Carrs Industrial Estate, Haslingden, Lancashire, BB4 5HH
This communication and the information it contains is intended for the person or organisation to whom it is addressed. Its contents are confidential and may be protected in law. If you have received this e-mail in error you must not copy, distribute or take any action in reliance on it. Unauthorised use, copying or disclosure of any of it may be unlawful. If you have received this message in error, please notify us immediately by telephone or email.
Flexipol Packaging Ltd. has taken every reasonable precaution to minimise the risk of virus transmission through email and therefore any files sent via e-mail will have been checked for known viruses. However, you are advised to run your own virus check before opening any attachments received as Flexipol Packaging Ltd will not in any event accept any liability whatsoever once an e-mail and/or any attachment is received.
It is the responsibility of the recipient to ensure that they have adequate virus protection.
Terms & Conditions: Notwithstanding delivery and the passing of risk in the goods, the property in the goods shall not pass to the buyer until the seller Flexipol Packaging Ltd. ("The Company") has received in cash or cleared funds payment in full of the price of the goods and all other goods agreed to be sold by the seller to the buyer for which payment is then due. Until such time as the property in the goods passes to the buyer, the buyer shall hold the goods as the seller's fiduciary agent and bailee and keep the goods separate from those of the buyer and third parties and properly stored protected and insured and identified as the seller's property but shall be entitled to resell or use the goods in the ordinary course of its business. Until such time as the property in the goods passes to the buyer the seller shall be entitled at any time -----Original Message----- From: ProFoxprofox-bounces@leafe.com On Behalf Of Paul Newton Sent: 29 May 2022 18:12 To:profox@leafe.com Subject: Sava as from IE application object or Web Browser control
Hi all
I want to programmatically save the current web page (which was loaded from an MHTML file):
I want to specify the name and location for the file to be saved and be able to specify "Save as Webpage, complete". Having Google researched, I do not believe this is possible. Can anybody prove me wrong?
The only approach I can think of is ExecWB(4,n) where n is 0, 1 or 2. If it cannot be done without user interaction, I would like that interaction to be as minimal as possible (e.g. putting the folder location in the clipboard so that the user can at least paste it into the save as dialog would help, as would being able to at least specify the file name). I can't find a way for the SaveAs dialog to default to Webpage, complete.
Many thanks
Paul Newton
--- StripMime Report -- processed MIME parts --- multipart/alternative text/plain (text body -- kept) text/html
[excessive quoting removed by server]