J
JayM
I have written the below code on a form click OK
I know you can set a password when saving but we have a Case Management
System which automatically saves the document for you. I need to be able to
set a password.
Firstly I am unsure how to check the password.
Secondly I need the txtPassword field to clear to it isn't there for the
next document.
Any help would be greatly appreciated. Maybe this is already out there and
I didn't need to write all this.
Private Sub cmdOK_Click()
Dim xPassword As String
xPassword = txtPassword
With ActiveDocument
.ReadOnlyRecommended = False
.Password = xPassword
.WritePassword = ""
.RemovePersonalInformation = False
.RemoveDateAndTime = False
End With
frmPassword.Hide
MsgBox "Your Password '" & xPassword & "' has been set", vbOKOnly
End Sub
I know you can set a password when saving but we have a Case Management
System which automatically saves the document for you. I need to be able to
set a password.
Firstly I am unsure how to check the password.
Secondly I need the txtPassword field to clear to it isn't there for the
next document.
Any help would be greatly appreciated. Maybe this is already out there and
I didn't need to write all this.
Private Sub cmdOK_Click()
Dim xPassword As String
xPassword = txtPassword
With ActiveDocument
.ReadOnlyRecommended = False
.Password = xPassword
.WritePassword = ""
.RemovePersonalInformation = False
.RemoveDateAndTime = False
End With
frmPassword.Hide
MsgBox "Your Password '" & xPassword & "' has been set", vbOKOnly
End Sub