Abort document close

Abort document close

Anonymous
Not applicable
157 Views
2 Replies
Message 1 of 3

Abort document close

Anonymous
Not applicable
In A2K, is there a way to prevent the document to close ? There's no Cancel
in the BeginClose event...

Thanks
________________________________
Alain Bouchard
Graduate Student
Geomatics Research Centre
Laval University
Sainte-Foy (Québec)
G1K 7P4

Alain.Bouchard@scg.ulaval.ca
0 Likes
158 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Would something like this work? I only have R14 here and it doesn't have a
BeginClose event so couldn't test it.

Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
If CommandName = UCase("CLOSE") Then
SendKeys "{Esc}"
End If
End Sub

"Alain Bouchard" wrote in message
news:94B9952992E019AE01C87626A1A5E209@in.WebX.SaUCah8kaAW...
> In A2K, is there a way to prevent the document to close ? There's no
Cancel
> in the BeginClose event...
>
> Thanks
> ________________________________
> Alain Bouchard
> Graduate Student
> Geomatics Research Centre
> Laval University
> Sainte-Foy (Québec)
> G1K 7P4
>
> Alain.Bouchard@scg.ulaval.ca
>
0 Likes
Message 3 of 3

Anonymous
Not applicable
Sorry, that doesn't work. The BeginCommand is raised only when the user type
"Close", it's not raised if the user close AutoCAD for example. Also, you
should never use SendKeys to send a message to AutoCAD, too risky. I'm
looking for a function to lock the document, only to prevent closing, not
editing.

Thanks anyway

Alain

Michael Kintz wrote in message
news:8C1E9A8BC5036192074FE31A04278305@in.WebX.SaUCah8kaAW...
> Would something like this work? I only have R14 here and it doesn't have
a
> BeginClose event so couldn't test it.
>
> Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
> If CommandName = UCase("CLOSE") Then
> SendKeys "{Esc}"
> End If
> End Sub
>
> "Alain Bouchard" wrote in message
> news:94B9952992E019AE01C87626A1A5E209@in.WebX.SaUCah8kaAW...
> > In A2K, is there a way to prevent the document to close ? There's no
> Cancel
> > in the BeginClose event...
> >
> > Thanks
> > ________________________________
> > Alain Bouchard
> > Graduate Student
> > Geomatics Research Centre
> > Laval University
> > Sainte-Foy (Québec)
> > G1K 7P4
> >
> > Alain.Bouchard@scg.ulaval.ca
> >
>
0 Likes