You can't stop a command from running using the CommandWillStart event.
You can try handling the DocumentCollection's DocumentLockModeChanged event, and if the GlobalCommandName property of the event arguments is "SAVEAS", then call the Veto() method of the event arguments.
--
http://www.caddzone.com
AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com
wrote in message news:5883753@discussion.autodesk.com...
Hi,
I want to cancel the "saveas" event through my code in vb.net. I am capturing the "saveas" event when user fires the "saveas" command and througgh my coding I am showing a saveas dialog with the name of the file of my choice and if he clicks Save button I am saving that dwg. But after this save again the save as dialog appears and also when I select Cancel button. Any idea how to achieve this task? In short what I want to do is in the "save as" dialog I want set the name of the file of my choice through coding and save it with that name.
I am using AutoCAD 2008 and vb.net.
Thanks in advance.