Hi everyone
I am handling BeginDocumentClose event of a Document but before my code executes MessageBox pops up asking me if a want to save my changes. Any idea how can i suppress it? Because i am asking use to end the process for this Document and if the user chooses No i am Vetoing the close so no need to Save changes.
Okay Here's a possible trick:
VBA Command way... meaning you just use .SendCommand(blah blah blah)
I took the idea from here... Forum Topic - Close without save
1st solution
(command "._VBASTMT" "ThisDrawing.Application.ActiveDocument.Close(vbFalse)")
2nd solution
(command "_.vbastmt" "thisdrawing.close vbfalse")
or Vb.NET
-But then you have to VBA enabled... hmmm that might not work for you.
Or close the document before Autocad can.
Sean has some stuff on this:
http://through-the-interface.typepad.com/through_the_interface/2007/03/closing_all_ope.html
Hmm... see code & methods would be ... ah ...
Methods:
Something along those lines.
Why are you using the begindocumentclose event anyhow?
Is any of this along the lines of what you're looking for? Best of luck. 🙂
Cheers.
🙂 although none of them is working for me , the way you wrote them may help making my mood 🙂
thanks anyway. here is a brief explanation ;
i am executing a command that shows a paletteset and allow user to make modifications by the commands on paletteset. if the user clicks the close button on my paletteset there is no problem. but if the user clicks the x button of document i want to ask user if he/she wants to exit modification process that i am serving. but the autocads save changes messagebox first pops up then mine. it makes an ignoring step when the user refuses to close my modification process.
i think it is clearer now.
😉
But i can use the "DBMOD" variable and store its current value and if i can set it to no modifications made constant then no popup . if it can be set ofcourse. but i think i got the qlue.
thanks.
bad news autocad invokes dialog before BeginDocumentClose event. i better try to set DBMOD in CommandWillStart event.