As you know, if you are using the dsoframer ocx to load a word document, somtime the web page will crash. Aim at the bug, we add an event to solve the issue.
Reasons: When IE parses the pages, it will construct its pages list of Object target automatically. At this same time object will automatically initialize its own. But they are synchronized, non-fixed timing. If IE called “Open” Interface of the ocx, but the ocx did not prepare its own window, it will lead to the anomaly.
Solution: Independent IE, after the ocx completes the initialization, derived an incident “NotifyCtrlReady”. In “NotifyCtrlReady” incident called Open Interface, can guarantee OCX window well prepared, there will be no anomaly.
Please referent the event interface:
[id(OA_DISPID_NOTIFYCTRLREADY), helpstring(“Ready to open document.”)]
HRESULT NotifyCtrlReady();
5 Responses to “Solve IE Crash when Onloads Office Document”
Leave a Reply
You must be logged in to post a comment.
May 30th, 2007 at 6:48 pm
I’m having issues using OA1_NotifyCtrlReady function on load to open a web document, IE crashes after a few seconds.
I’m using the downloaded asp.net sample and I added this procedure
Sub OA1_NotifyCtrlReady()
OA1.Open “http://localhost/Test/Sample.doc”
End Sub
is there a better way to open a document from the start?
May 31st, 2007 at 5:16 am
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>EDraw Office Viewer Component</title>
<SCRIPT FOR=EDrawOfficeViewer1 EVENT=NotifyCtrlReady()>
NotifyCtrlReadyEvent()
</SCRIPT>
</head>
<script language="VBScript">
Sub NotifyCtrlReadyEvent ()
EDrawOfficeViewer1.Open "http://www.ocxt.com/demo/sample.doc"
End Sub
</script>
<body>
<object classid="clsid:053AFEBA-D968-435F-B557-19FF76372B1B"
id="EDrawOfficeViewer1" width="657" height="452">
<param name="Titlebar" value="-1">
<param name="Toolbars" value="0">
<param name="Caption" value="EDraw Office Viewer Component">
<param name="Menubars" value="-1">
<param name="BorderStyle" value="1">
<param name="BorderColor" value="-2147483632">
<param name="BackColor" value="16777215">
<param name="ForeColor" value="12632256">
<param name="TitlebarColor" value="-2147483635">
<param name="TitlebarTextColor" value="-2147483634">
<param name="WaitingText" value="Loading the office document!">
<param name="DocumentFullName" value>
<param name="FileMenu" value="&File">
<param name="FileMenu_New" value="&New… Ctrl+N">
<param name="FileMenu_Open" value="&Open… Ctrl+O">
<param name="FileMenu_Close" value="&Close">
<param name="FileMenu_Save" value="&Save Ctrl+S">
<param name="FileMenu_SaveAs" value="Save &As…">
<param name="FileMenu_PageSetup" value="Page Set&up…">
<param name="FileMenu_PrintPreview" value="Print Pre&view">
<param name="FileMenu_Print" value="&Print…">
<param name="FileMenu_Properties" value="Propert&ies">
<param name="FileMenu_ExitPrintPreview" value="E&xit Preview">
</object>
</body>
</html>
August 18th, 2007 at 7:20 am
The follow is a Javascript sample:
<script language = javascript id=clientEventHandlersJS >
function OA1_NotifyCtrlReady()
{
// alert(“fasdfdasf”);
}
</script>
<script language = javascript FOR=OA1 event = NotifyCtrlReady>
OA1_NotifyCtrlReady()
</script >
<body Onload=”InitCtrl()”>
October 14th, 2008 at 12:45 pm
where is the moderation?
October 17th, 2008 at 9:19 am
Only call the Open method in the NotifyCtrlReadyEvent.
Sub NotifyCtrlReadyEvent ()
OA1.Open “http://www.ocxt.com/demo/samples/sample.doc”
End Sub