Canceling Document BeginSave Event
CADForums.net Forum Index CADForums.net
Discussion of AutoCAD and other CAD software.
 
 FAQFAQ   MemberlistMemberlist     RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
 
Google
 
Web cadforums.net
Canceling Document BeginSave Event

 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA
Author Message
egcallis
Guest





Posted: Fri Jan 28, 2005 11:15 pm    Post subject: Canceling Document BeginSave Event Reply with quote

VBA AutoCAD 2004

We want to cancel the save event if the user does not properly fill out a form. Here is the current code:

Private Sub AcadDocument_BeginSave(ByVal FileName As String)
If (FileName Like "Q:\CADD MASTERS\_Corporate*" And Right(FileName, 3) = "dwg" And Not ThisDrawing.Saved) Then
MasteroMatic.UserForm1.show
If (Not bOkay) Then
'DO something to cancel the save operation
End If
End If
End Sub

Back to top
Frank Oquendo
Guest





Posted: Sun Jan 30, 2005 3:49 am    Post subject: Re: Canceling Document BeginSave Event Reply with quote

egcallis wrote:
Quote:
VBA AutoCAD 2004

We want to cancel the save event

You're trying to cancel the event you're handling. In such a situation,
you need to check for a Cancel parameter as part of the event's
signature. If you don't see one, you should not attempt to cancel the
event in question from that event handler.

Have you given any thought to redefining the SAVE and QSAVE commands?
They could perform the necessary checks and call the internal version of
those commands if everything checks out.

--
There are 10 kinds of people: those who understand binary and those who
don't.
Back to top
Nathan Taylor
Guest





Posted: Mon Jan 31, 2005 3:15 am    Post subject: Re: Canceling Document BeginSave Event Reply with quote

Even if you redefine all the save commands you can't handle when AutoCAD prompts you to save.
Regards - Nathan

Back to top
Nathan Taylor
Guest





Posted: Mon Jan 31, 2005 3:25 am    Post subject: Re: Canceling Document BeginSave Event Reply with quote

But it probably doesn't matter in this case.
Back to top
 
Post new topic   Reply to topic    CADForums.net Forum Index -> VBA All times are GMT
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

Access Forum - Microsoft Office Forum - Windows Server - Electronics

Contact Us Powered by phpBB