VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

stop saving document

3 REPLIES 3
Reply
Message 1 of 4
a7v1n
219 Views, 3 Replies

stop saving document

Hi. Is there any code that makes the drawing file unsavable? Or change the drawing to read only when the user tries to save the drawing? Thanks a lot.
3 REPLIES 3
Message 2 of 4
bigr1822
in reply to: a7v1n

If someone has the answer for the, not being able to save the file, I would love to hear it.

You can close the drawing using, "thisdrawing.close"
change the attributes using"SetAttr , vbReadOnly
then open the drawing using, "thisdrawing.open(filename & Location as string)

I wanted to use this for our Electrical software, but not going to work. I would like the file to just not be saveable!

Rodney
Message 3 of 4
rocheey
in reply to: a7v1n

Im guessing you can intercept the save event; Ive seen shareware for Acad that did much the same... and as such, was equally as easy to bypass using the VBA API
Message 4 of 4
cadger
in reply to: a7v1n

i thought the same, and something like this could work for saveas but seems too slow for qsave, don't know if it would work for a larger dwg, but doubt it... please excuse the sendkeys...

{code}
Private Sub AcadDocument_BeginCommand(ByVal CommandName As String)
If CommandName = "QSAVE" Then
'MsgBox ("NO SAVE!")
'AppActivate ThisDrawing.Application.Caption
SendKeys "{ESC}" & "{ESC}" & "{ESC}", False
End If
End Sub
{code}

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

Post to forums  

”Boost