.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BeginDocumentClose - Save confirmation messagebox

3 REPLIES 3
Reply
Message 1 of 4
cincir
671 Views, 3 Replies

BeginDocumentClose - Save confirmation messagebox

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.

3 REPLIES 3
Message 2 of 4
VB_Autocad_guy
in reply to: cincir

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:

Document.CloseAndDiscard 
Document.CloseAndSave
DocumentCollection.CloseAll

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.

 

 

 

Message 3 of 4
cincir
in reply to: VB_Autocad_guy

🙂 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.

😉

Message 4 of 4
cincir
in reply to: cincir

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.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost