Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Open Word read/only, prevent save as, release variable
Message
From
27/07/2007 14:05:58
 
 
To
27/07/2007 09:39:51
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Miscellaneous
Thread ID:
01244081
Message ID:
01244205
Views:
15
>1. Is it possible to limit the user to only "Exit", "Page Setup" and "Print" in the File menu? I so how?

The same mechanism you're using to turn off Save As should work, but if you really only want the user to be able to print the document, maybe you're taking the wrong approach altogether. Isn't there a document viewer available for Word?


>2. Is it possible to check if word document is already open so that I can tell user and not do it again? If so how.

Loop through Word's Documents collection and check for your document.

>3. I have been told that I need to use the "Event Handler" to know when the user exits word so that I can release the word object loWord. I was pointed to a document which I do not quit understand it. Could some one please show what code I need (if I need to do anything), i.e. what do I do with object loWord so that I do not have multiple occurrences of the object?

If the user closes Word, you don't need to do anything. If the user closes the document, but doesn't close Word, you probably don't need to do anything until you shut down your application.

The important question here is whether the user should be able to keep the document and Word open when they close whatever it is in your program that opens Word. If not, just make sure the current form or whatever issues loWord.Quit().

If you're likely to need Word more than once in the app's session, you should store the object reference to Word somewhere that it won't be lost when you leave the current form/PRG/whatever. That way, you can keep using the same Word instance. An app-level property will work for that.

Tamar
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform