Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I need help if users choose no to prompt a password open the document. Is it possible with this example?
Thank you
Sub DisplayMessage
Answer = MsgBox("Expired",4,"Title")
If (Answer=6) and ActiveDocument.Evaluate("today() - makedate(2019,1,1)") > 0 Then
ActiveDocument.GetApplication.Quit
Else
if (Answer=7) and ActiveDocument.Evaluate("today() - makedate(2019,1,1)") > 0 then
' If No (Answer=7) I would like to prompt a password to open the document...
End If
end if
End Sub
The macro-execution (regardless what is within the macro) could be easily bypassed. Therefore I doubt that's really suitable for what do you want to do. But the already mentioned section access might be a solution for your tasks.
- Marcus
I already implemented Section Access and set module password, so Users cannot access to properties.
I found a solution to prompt for a password if trial period is expired.
Thank you
Sub DisplayMessage()
if ActiveDocument.Evaluate("today() - makedate(2019,1,1)") > 0 then
Answer = MsgBox("Trial period expired",4,"Title")
If (Answer=6) and ActiveDocument.Evaluate("today() - makedate(2019,1,1)") > 0 Then
ActiveDocument.GetApplication.Quit
Else
if (Answer=7) and ActiveDocument.Evaluate("today() - makedate(2019,1,1)") > 0 then
myValue = InputBox("Password?")
if myValue = "MYPASSWORD" then
Msgbox "Welcome Admin"
else
ActiveDocument.GetApplication.Quit
End If
End if
End if
End if
End Sub