Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
File Protect using Word Automation
Message
De
11/06/2003 12:14:53
Kathy Wilson
Naval Surface Warfare Center
Crane, Indiana, États-Unis
 
 
À
10/06/2003 14:09:06
Kathy Wilson
Naval Surface Warfare Center
Crane, Indiana, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00798443
Message ID:
00798990
Vues:
24
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
Fil
Voir

Click here to load this message in the networking platform