2008年11月20日 星期四

屬性 Action 範例

Sub Example_Action()
    ' 本範例加密並儲存檔案

    Dim acad As New AcadApplication
    Dim sp As New AcadSecurityParams

    acad.Visible = True
    sp.Action = AcadSecurityParamsType.ACADSECURITYPARAMS_ENCRYPT_DATA
    sp.Algorithm = AcadSecurityParamsConstants.ACADSECURITYPARAMS_ALGID_RC4
    sp.KeyLength = 40
    sp.Password = UCase("mypassword") '將密碼轉換為大寫英文字母
    sp.ProviderName = "Microsoft Base Cryptographic Provider v1.0"
    sp.ProviderType = 1

    acad.ActiveDocument.SaveAs "C:\MyDrawing.dwg", , sp

End Sub

沒有留言: