Drawing Password

Discussion in 'AutoCAD' started by Kevin Grigsby, Jan 19, 2004.

  1. Has anyone ever SET a drawing password using VBA when you do a SAVEAS?

    I have tried it a few different ways and it keeps crashing my machine. Did
    a search on the internet for a few different words and nothing. The
    documentation talks about the Password, but only for Opening a drawing.

    Thanks,
    Kevin Grigsby
     
    Kevin Grigsby, Jan 19, 2004
    #1
  2. Thanks to a colleague,

    Sub test()
    Dim oSecurity As AcadSecurityParams
    Set oSecurity = New AcadSecurityParams
    With oSecurity
    .Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    .Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    .Comment = "My test"
    .Issuer = "MTuersley"
    .KeyLength = 40
    .Password = UCase("mypassword")
    .ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    .ProviderType = 1
    .TimeServer = ""
    End With
    ActiveDocument.SaveAs "C:\MyDrawing.dwg", , oSecurity
    End Sub
     
    Kevin Grigsby, Jan 19, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.