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 09:39:51
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Title:
Open Word read/only, prevent save as, release variable
Miscellaneous
Thread ID:
01244081
Message ID:
01244081
Views:
94
With the help of others on the Universal thread I am able to open a word file in read/only mode (i.e save is diabled in the "File" menu) using Word automation.
My current code to invoke word and open the file is
#DEFINE wdWindowStateMaximize 1

loWord    = CREATEOBJECT("Word.Application")
lcDocFile = gcdef + '\Documebtation\ADS_VFP_User_Doc.doc'
loWord.Documents.Open(m.lcDocFile,,.t.) && third parameter is read-only
loWord.visible = .t.
loWord.WindowState = wdWindowStateMaximize 
I have several questions.

1. Is it possible to limit the user to only "Exit", "Page Setup" and "Print" in the File menu? I so how?

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.

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?
Next
Reply
Map
View

Click here to load this message in the networking platform