DsoFramer ActiveX Control Problem

O

Owen

I am having a problem with the BeforeDocumentSaved event for the DsoFramer:
http://support.microsoft.com/default.aspx?scid=kb;en-us;311765

Here is the sig:

BeforeDocumentSaved(ByVal Document As Object, ByVal Location As String,
Cancel As Boolean)

I *can* get the save to be cancelled in VB6: e.g.

Private Sub oFramer_BeforeDocumentSaved(ByVal Document As Object, ByVal
Location As String, Cancel As Boolean)
MsgBox "not going to save :p"
Cancel = True
End Sub

But I *can't* get this to cancel in VBScript or JScript...

JScript:
<script language="JScript" for="oframe" event="BeforeDocumentSaved(Document,
Location, Cancel)">
BeforeDocumentSaved(Document, Location, Cancel)
</script>
function BeforeDocumentSaved(Document, Location, Cancel){
alert("will still save :(");
Cancel=true;
}

VBScript:
Sub oframe_BeforeDocumentSaved(Document, Location, Cancel)
MsgBox "saving"
Cancel = True
End Sub

Can someone offer some ideas on how to get this to cancel the save. My
thoughts are that somehow this is passing the Cancel parameter by value
rather than reference.

Thanks,
Owen.
 
Top