Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

Accessing Save As "Web Page, complete" in IE?

Posted on 2005-04-21
8
Medium Priority
?
392 Views
Last Modified: 2012-06-21
Using SHDocVw or MSHTML objects in VB.NET, how can I access the File | Save As "Web Page, complete" menu item in IE?

I already have an IE window open and have loaded a  page into it.

Thanks,
Brett
0
Comment
Question by:brettr
  • 4
  • 4
8 Comments
 
LVL 12

Expert Comment

by:S-Twilley
ID: 13837575
Im not sure about getting a webpage complete, but you can send "commands" to a browser.

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/webbrowser/reference/methods/execwb.asp

and use the Save_as constant...

http://msdn.microsoft.com/library/default.asp?url=/workshop/browser/mshtml/reference/constants/saveas.asp

Let me know if you have trouble implementing this... sorry I can't post code up at the moment, in the process of fixing my installation (keep gettin an error when requesting help)
0
 

Author Comment

by:brettr
ID: 13837738
Thanks.  I'm getting close with this:

Me.IE_Inst.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER)

The "web page complete" is defaulted and I have a box open waiting for me to click save.  Now I need the ability to give the file a name, path, and save programmatically.  Any suggestions?

0
 
LVL 12

Expert Comment

by:S-Twilley
ID: 13838142
Me.IE_Inst.ExecWB(SHDocVw.OLECMDID.OLECMDID_SAVEAS, SHDocVw.OLECMDEXECOPT.OLECMDEXECOPT_DONTPROMPTUSER, "C:\\Test Folder\\Some Folder\\mypage.html", Nothing)


Explanation of path (from msdn):

pvaIn VARIANT of type VT_BSTR that specifies the path and file name of the file to which to save the Web page. When the path contains more than one folder name, separate the folder names with two backward slashes (\\).
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

Author Comment

by:brettr
ID: 13838664
If I use two backslashes, the file name isn't included.  Using one backslash, it is included.  However, I'm still prompted but this time everything is prefilled.  Also, it is going to HTML save as type, rather than complete web page.  Any ideas?
0
 
LVL 12

Expert Comment

by:S-Twilley
ID: 13838970
I tried doing it myself and had no luck... should work according to MSDN... hmmm

Well, Im not sure how to automate that command then...  I know how to download the html file without the pictures (i.e. the html code file)... i suppose if you use the document object, you could retrieve that from the IE instance, loop through for all objects (images and activex), then download those with the html file and emulate the command. Just don't understand why the execWB  (or document.execCommand) doesn't work.

0
 

Author Comment

by:brettr
ID: 13839554
That feature has been disabled for security reasons: http://groups.google.de/groups?selm=L3yAKK0RCHA.2372%40cpmsftngxa07

Ok, is there any way to mimick it?  Macro...something...anything?
0
 
LVL 12

Accepted Solution

by:
S-Twilley earned 500 total points
ID: 13840809
Well I can mimic it... you can download the html file... and also download the htmldocument object that matches the html file... and then go through the objects of that html file which point to files (things such as images, embedded objects, script files and others)...  you can go into less or more detail... which webpages are you thinking of downloading, any in particular?
0
 

Author Comment

by:brettr
ID: 13841430
Yahoo mail message for example.  Do you have samples of how to do the above?
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question