brettr
asked on
Accessing Save As "Web Page, complete" in IE?
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
I already have an IE window open and have loaded a page into it.
Thanks,
Brett
ASKER
Thanks. I'm getting close with this:
Me.IE_Inst.ExecWB(SHDocVw. OLECMDID.O LECMDID_SA VEAS, SHDocVw.OLECMDEXECOPT.OLEC MDEXECOPT_ DONTPROMPT USER)
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?
Me.IE_Inst.ExecWB(SHDocVw.
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?
Me.IE_Inst.ExecWB(SHDocVw. OLECMDID.O LECMDID_SA VEAS, SHDocVw.OLECMDEXECOPT.OLEC MDEXECOPT_ DONTPROMPT USER, "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 (\\).
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 (\\).
ASKER
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?
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.
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.
ASKER
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...anythi ng?
Ok, is there any way to mimick it? Macro...something...anythi
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yahoo mail message for example. Do you have samples of how to do the above?
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)