Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Opening a word document in read only
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
00664062
Message ID:
00664092
Views:
18
In addition to Cetin's replay you can protect document and unprotect it if needed (user will have no ability to actually write anything).
Something like:
to protect: oWord.ActiveDocument.Protect(2,.f.,lcpassword)
to unprotect: oWord.ActiveDocument.UnProtect(lcpassword)

You can call these actions depending on whether document is open already or not. Someyhing like:
lnfp=fopen("WordDoc.doc",2)
if lnfp>0
fclose(lnfp)
.....
oWord.ActiveDocument.UnProtect(lcpassword)
.......

* protect it back before closing
oWord.ActiveDocument.Protect(2,.f.,lcpassword)
......


else
.....
oWord.documents.open("WordDoc.doc",,.t.)
....

Regards

>I want to be able to open a word document even when its open by another user in read only mode, I don't want the computer to tell me if the file is already open, I want to open it anyway without any user-intervention.
>
>Anyone know how?
>
>Regards
>RC
>BSS
Previous
Reply
Map
View

Click here to load this message in the networking platform