Microsoft Knowledge Base Article
This article contents is Microsoft Copyrighted material.
©2005-©2007 Microsoft Corporation. All rights reserved.
Terms
of Use |
Trademarks
Article ID: 258486 - Last Review: January 27, 2007 - Revision: 1.3
Visio2000: The VBA Query Events Sample in the DVS Folder of Visio Standard 2000 International English Doesn't Work
This article was previously published under Q258486
The sample file "VBA Query Events.VSD" does not work as it is described on the Visio drawing that the VBA code is attached to. Rather than asking you to confirm deletion of the currently selected objects, you receive the following message:
Selection is about to be deleted.
You can only click
OK. You cannot prevent the deletion.
The
Document_QueryCancelSelectionDelete function in the sample file does not reference the
QuerySelectionDelete event correctly.
To work around this behavior, modify the
Document_QueryCancelSelectionDelete function as follows:
- Instead of referencing QuerySelectionDelete, which returns an integer, reference QueryCancelSelectionDelete, which returns a Boolean value.
- Return FALSE to allow the operation and TRUE to cancel it, which is the opposite of the sample code.
The
Document_QueryCancelSelectionDelete function should appear in the code as follows:
Private Function Document_QueryCancelSelectionDelete(ByVal Selection As IVSelection) As Boolean
Dim msgBoxResult As VbMsgBoxResult
Dim bRetVal As Boolean
'Verify user wants to delete
msgBoxResult = MsgBox("Would you like to cancel the deletion?", _
vbYesNo, "QuerySelectionDelete Event")
'Check user answer
Select Case msgBoxResult
Case vbYes
bRetVal = True
Case vbNo
bRetVal = False
Case Else
bRetVal = False
End Select
'return value to allow or cancel deletion
Document_QueryCancelSelectionDelete = bRetVal
End Function
APPLIES TO
- Microsoft Visio 2000 Standard Edition
- Microsoft Visio 2000 Technical Edition
- Microsoft Visio 2000 Professional Edition
- Microsoft Visio 2000 Enterprise Edition
| kbbug kbdocerr kbdtacode kbpending KB258486 |
Retired KB Content DisclaimerThis article was written about products for which Microsoft no longer offers support. Therefore, this article is offered "as is" and will no longer be updated.
Community Feedback System
Very often, it takes hours to solve a problem. Very often, you've looked high
and low, and have tried a lot of solutions. When you finally found it, chances
are, it was because someone else helped you. Here's your chance to give back.
Use our community feedback tool to let others know what worked for you and what
didn't.
Please also understand that the community feedback system is not warranted to be
correct, it's simply a system that we've built to let people try and help each
other. If something in a feedback response doesn't make sense to you, or you're
not comfortable making changes that the feedback talks about (like registry
edits), please consult a professional.
Thank you for using kbAlertz.com Feedback System.
-- Scott Cate