Boolean MakeArchiveFromDoc(
Var varHtmlDocument,
String mhtFile
);
String MakeArchiveFromDoc2(
Var varHtmlDocument,
String mhtFile
);
Parameters
- htmlFile
- Var - HTML document object
-
- mhtFile
- String - Path to the output web archive MHT file. Use
"webarchivex-prompt:[TITLE]" instead of path, to invoke "Save File" dialog.
[TITLE] is an optional string that will appear as a title of the Save File Dialog window.
If [TITLE] string is empty (the argument is just "webarchivex-prompt:"), the default "Save As"
title will be used. If user hits "Cancel", MakeArchiveFromDoc immediately return
empty string.
Return value
(1) True if succeeded (2)
Path to the created MHT or empty string if failed or canceled.
HRESULT MakeArchiveFromDoc(
[in] VARIANT varHtmlDocument,
[in] BSTR bstrMhtFile,
[out, retval] VARIANT_BOOL *pRet
);
HRESULT MakeArchiveFromDoc2(
[in] VARIANT varHtmlDocument,
[in] BSTR bstrMhtFile,
[out, retval] BSTR* pRet
);
Parameters
- varHtmlDocument
- [in] VARIANT - IDispatch of HTML document object
-
- bstrMhtFile
- [in] BSTR - Path to the output web archive MHT file. Use
"webarchivex-prompt:[TITLE]" instead of path, to invoke "Save File" dialog.
[TITLE] is an optional string that will appear as a title of the Save File Dialog window.
If [TITLE] string is empty (the argument is just "webarchivex-prompt:"), the default "Save As"
title will be used. If user hits "Cancel", MakeArchiveFromDoc immediately
returns empty string.
-
- pRet
- [out, retval] VARIANT_BOOL* - Returns
true if archiving succeeded.
- [out, retval] BSTR* - Returns path if archiving succeeded, or empty
string if failed or canceled by user.
Return value
Returns S_OK if successful, or an error value otherwise.
Sample
IDispatch *pDoc = NULL;
pWebBrowser->get_Document(&pDoc); // Assume valid pWebBrowser pointer
VARIANT var;
var.vt = VT_DISPATCH;
var.pdispVal = pDoc;
BSTR bstrPath;
pBuilder->MakeArchiveFromDoc(var, szPath, &bstrPath);
// ... check the path and release all interfaces