I'm trying to write a quick app which will browse through a folder, find the word document files and apply a standard password to each file.
I've exhausted my searches on Word VBA but can't get the password to stick.
This is what I have so far:
Dim iword As New Word.Application, idoc as Word.Document
Set idoc = iword.Documents.Open(WordPath & WordFile)
idoc.Password = Password
idoc.Close
I even incorporated this if clause, which indicated that the password was being applied:
If idoc.HasPassword = True Then MsgBox "Password set for: " & WordFile, vbInformation, "PASSWORD"
I've also tried:
idoc.SaveAs WordPath & WordFile, , , Password, False
but to no avail.
I would expect the Modified date/time to be updated by this last command, but the save doesn't appear to be workiing.
Any suggestions?
Remy Still new to DB's and enjoying learning day by day
I've exhausted my searches on Word VBA but can't get the password to stick.
This is what I have so far:
Dim iword As New Word.Application, idoc as Word.Document
Set idoc = iword.Documents.Open(WordPath & WordFile)
idoc.Password = Password
idoc.Close
I even incorporated this if clause, which indicated that the password was being applied:
If idoc.HasPassword = True Then MsgBox "Password set for: " & WordFile, vbInformation, "PASSWORD"
I've also tried:
idoc.SaveAs WordPath & WordFile, , , Password, False
but to no avail.
I would expect the Modified date/time to be updated by this last command, but the save doesn't appear to be workiing.
Any suggestions?
Remy Still new to DB's and enjoying learning day by day