I have a problem I would like to ask about.I want to open a WinWord document from LN client and to
move data back to Notes when document is closed. I have tried
many solutions, such as:
-
WaitForSingleObject API
-
Open fileName For Random Lock Read Write As filenum
-
external VB application with a MS Word object in it with WithEvents declaration.
This is the closest one, because it in conjuction with the 1st solution allows to detect if a specific opened document has been closed. But it’s got a problem with references. The references to MS Word are not backwards compatible.
- internal embedded document in Lotus Notes - the Word does not close sometimes, and the menus are different from the ones in Word.
First I thought this is not a problem at all - the problem description is easy.
But when tried to do something about it - it turned out to be a real nightmare.
Please help 
Subject: LN Word editing problem
It sounds like what you mean is that you want to create a NEW word doc and grab its data? If so, the first thing I would consider is using the existing MSOffice Document Library template to allow generating word documents from within Notes with zero effort, since it’s a template.
If that doesn’t satisfy, I would imagine there’s a way to use OLE automation to grab onto an unsaved word doc from an open instance of the app.
(btw, there’s no need to post in both forums, as those who answer posts read both forums.)
Subject: Found 3 solutions, one of them is unbelievable 
Ok, after some nights without sleep I have found 3 ways to open a document in word and catch the document_close event after that.The solutions are:
-
Wrote a M$ Visual C++ application with sinks implemented to catch Document_Close event. This works well, but the Document_Close does not allow to cancel the editing of the document.
-
Wrote a Lotus Notes script that creates a timer which periodicaly checks for Word.Document.ActiveWindow object and if it’s closed then return handle to the LS. This is good if you want the user not be able to do anything in LN, since the LN is waiting for the word document to close.
-
If you want to open a document and catch any outside event detectable with LotusScript, I can show you a way
Its a co-operation with JavaScript and LotusNotes involved, and it works in Lotus Notes client (I have posted about this before). You will then be able to launch applications, wait for them to finish and then LN will notify you that tasks are completed! :)) If you have any interest on this one, I can send you a database with a form, which has one button for opening word documents. When the document is closed, LS notifies you of that…
Subject: RE: Found 3 solutions, one of them is unbelievable 
Why not post the solutions in the Sandbox?