RestoreState
Restores the previously saved editing state.
Syntax
HRESULT RestoreState( BSTR nameID );
Parameters
nameID
[in] Name of the session to be restored. Return Values
Remarks
An editing
state saved more than 10 minutes prior cannot be restored.
Sample Codes
JScript
<html> <head> <meta http-equiv="content-type" content="text/html> <title>Web Editor Control 6</title> </head> <body bgcolor="white" text="black" onunload="OnUnLoad()"> <center> <OBJECT WIDTH=0 HEIGHT=0 CLASSID='CLSID:5220cb21-c88d-11cf-b347-00aa00a28331'> <PARAM NAME='LPKPath' VALUE='/control/NamoWec4_Namo.lpk'> </OBJECT> <OBJECT ID='Test' CLASSID='CLSID:C5AC95C0-C873-445B-BA1F-3A430A4DEA42'
WIDTH='640' HEIGHT='480' CODEBASE='/control/NamoWec.cab#version=4,0,0,19'> <PARAM NAME='InitFileURL' VALUE='/control/namowec.env'> </OBJECT> <SCRIPT LANGUAGE="JavaScript"> <!-- function OnUnLoad() { var objNamo = document.Test; objNamo.SaveState("wec"); // Save the current editing state. </SCRIPT> <SCRIPT LANGUAGE="JScript" FOR="Test" EVENT="OnInitCompleted()"> var objNamo = document.Test; objNamo.RestoreState("wec"); // Restore the editing state saved before.
</SCRIPT> </center></body></html>
VBScript
<html> <head> <meta http-equiv="content-type" content="text/html> <title>Web Editor Control 6</title> </head> <body bgcolor="white" text="black" onunload="OnUnLoad()"> <center> <OBJECT WIDTH=0 HEIGHT=0 CLASSID='CLSID:5220cb21-c88d-11cf-b347-00aa00a28331'> <PARAM NAME='LPKPath' VALUE='/control/NamoWec4_Namo.lpk'> </OBJECT> <OBJECT ID='Test' CLASSID='CLSID:C5AC95C0-C873-445B-BA1F-3A430A4DEA42'
WIDTH='640' HEIGHT='480' CODEBASE='/control/NamoWec.cab#version=4,0,0,19'> <PARAM NAME='InitFileURL' VALUE='/control/namowec.env'> </OBJECT>
<SCRIPT LANGUAGE="VBScript"> <!-- function Window_OnbeforeUnload() document.TestSaveState "wec" ' Save the current editing state. End Function Function Test_OnlnitCompleted document.TestRestoreState "wec" ' Restore the editing state saved before. End Function </SCRIPT> </center></body></html>
See Also
SaveState
|