![]() |
|
#1
|
|||
|
|||
|
Hi Hi
I have problem writing a code to close a document but with password protected without saving if user does not want to save. This code is not able to password protect if user decides not to save the file and exit word. Code:
Private Sub Document_Close()
With ActiveDocument
If .ProtectionType = wdNoProtection Then
.Protect wdAllowOnlyReading, NoReset:=True
Else
.Unprotect
End If
End With
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Close Document Without Saving Prompt
|
Joe528 | Word | 3 | 10-08-2021 06:12 PM |
Looking for ideas for a foolproof password-protected template/document
|
Sarcas | Word | 2 | 09-11-2019 01:21 AM |
| VBA Macro to Open password protected Word Documents | gennylk | Word VBA | 2 | 01-11-2018 11:03 PM |
Macro to Unprotect password protected document
|
pooklet | Word | 2 | 12-08-2014 01:32 AM |
| How to open a password-protected word document? | navalava | Word | 1 | 07-01-2012 12:15 PM |