Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
File Protect using Word Automation
Message
From
11/06/2003 12:14:53
Kathy Wilson
Naval Surface Warfare Center
Crane, Indiana, United States
 
 
To
10/06/2003 14:09:06
Kathy Wilson
Naval Surface Warfare Center
Crane, Indiana, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00798443
Message ID:
00798990
Views:
25
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
Map
View

Click here to load this message in the networking platform