General information
Category:
Coding, syntax & commands
Like a dog with a bone, I couldn't let go! I did find a solution after going to Word and experimenting a bit. I encountered the problem when the cursor was positioned in a selectable text area. When I moved the cursor out of this area, the Protect document for Forms option became available.
Closing the document and then re-opening it using Word Automation causes the cursor to be in a non-selectable text area, thus enabling the Protect document for Forms option. This is the code that worked for me.
THISFORM.oWord.ActiveDocument.SAVEAS(THISFORM.cADLWordDocPath,0,.F.,"",.F.,"",.F.,.F.,.F.,.F.,.F.)
THISFORM.oWord.ActiveDocument.CLOSE
THISFORM.oWord.Documents.OPEN(THISFORM.cADLWordDocPath)
THISFORM.oWord.ActiveDocument.PROTECT(2,.F.,"password")
THISFORM.oWord.ActiveDocument.CLOSE
Previous
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only