Information générale
Catégorie:
Codage, syntaxe et commandes
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
Précédent
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement