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.)
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?