| Author |
Message |
Matt W
Guest
|
Posted:
Sat Jan 08, 2005 12:12 am Post subject:
Cancel a Save?? |
|
|
It doesn't look like this can be done but I just wanted to verify.
I've got this snippet of code in my BeginCommand event not the BeginSave
event...
Case "QSAVE"
retVal = MsgBox("Would you like to save?", vbYesNo, "Save Test")
If retVal = vbYes Then
MsgBox "Save"
Else
MsgBox "Don't Save"
End If
If I select No, it still saves. Is there any way around this??
--
I support two teams: The Red Sox and whoever beats the Yankees.
|
|
| Back to top |
|
 |
Ed Jobe
Guest
|
Posted:
Sat Jan 08, 2005 1:08 am Post subject:
Re: Cancel a Save?? |
|
|
Unfortunately, once a command has started, you can't cancel it. This has
been a api wishlist item for years. The events signature should look like:
Private Sub Doc_BeginCommand(ByVal CommandName As String, Cancel As Boolean)
End Sub
That way, in your If logic, instead of just MsgBox "Don't save.", you would:
Cancel = vbTrue. Your only option is to redefine the QSAVE command.
--
----
Ed
----
"Matt W" <nospam@address.withheld.com> wrote in message
news:41dedf06_3@newsprd01...
| Quote: | It doesn't look like this can be done but I just wanted to verify.
I've got this snippet of code in my BeginCommand event not the BeginSave
event...
Case "QSAVE"
retVal = MsgBox("Would you like to save?", vbYesNo, "Save
Test")
If retVal = vbYes Then
MsgBox "Save"
Else
MsgBox "Don't Save"
End If
If I select No, it still saves. Is there any way around this??
--
I support two teams: The Red Sox and whoever beats the Yankees.
|
|
|
| Back to top |
|
 |
Matt W
Guest
|
Posted:
Sat Jan 08, 2005 1:17 am Post subject:
Re: Cancel a Save?? |
|
|
That's what I thought.
Thanks for the verification Ed.
--
I support two teams: The Red Sox and whoever beats the Yankees.
"Ed Jobe" <not.edljobe@hotmail.com> wrote in message
news:41deec50$1_3@newsprd01...
| Quote: | Unfortunately, once a command has started, you can't cancel it. This has
been a api wishlist item for years. The events signature should look like:
Private Sub Doc_BeginCommand(ByVal CommandName As String, Cancel As
Boolean)
End Sub
That way, in your If logic, instead of just MsgBox "Don't save.", you
would:
Cancel = vbTrue. Your only option is to redefine the QSAVE command.
--
----
Ed
----
"Matt W" <nospam@address.withheld.com> wrote in message
news:41dedf06_3@newsprd01...
It doesn't look like this can be done but I just wanted to verify.
I've got this snippet of code in my BeginCommand event not the BeginSave
event...
Case "QSAVE"
retVal = MsgBox("Would you like to save?", vbYesNo, "Save
Test")
If retVal = vbYes Then
MsgBox "Save"
Else
MsgBox "Don't Save"
End If
If I select No, it still saves. Is there any way around this??
--
I support two teams: The Red Sox and whoever beats the Yankees.
|
|
|
| Back to top |
|
 |
|
|
|
|