views:

375

answers:

0

Hi, I'm trying to save a web page as MHTML (.mht) file in Internet Explorer 7. I googled and found some javascript lines + an activex to accomplish that:

<script type="text/javascript">
function save()
{
  document.all.WebBrowser.ExecWB(4,1);
}
</script>    
<object id="WebBrowser" width='0' height='0' classid="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></object>
<a href="javascript:save();">save this page</a>

And, disabling some browser security policies (it's an intranet web application), it works without alerts nor errors. The problem arise when my page is placed inside an iframe on the same web application: instead of saving just my page (ie the iframe), the browser saves the entire parent page + my iframe!

Is there a way to explicitly tell the WebBrowser control to save only the document where it is in (his iframe) and not the entire page?

Thanks, ssoc