>First of all, if you want this just to restrict users editing of the document after preview, make the DOC file created by Word read-only, than open it in Word again and preview.
This means we have to save a copy on disk. It'd like in VFP where all preview would go on disk. Too much management. :) I'd prefer another approach.
>If you wand to close word immediately after preview closed... Well, you than need to find a way HOW distinguish from VFP the states of the Word to see if it is in preview mode or it is just in document editing state. I don't know how. However, if preview cuses modal state in the OLE Automation, than returning control to VFP is a sign of finishing of the preview mode and you can close the document from VFP. If this cause no modal state, than you require to check Word state in a loop and see if Word is still in preview mode...
The way it is now, the control is immediately return to VFP after the preview has been initiated.
After Word has opened the document, this is what we have:
loWord.Visible=.T.
loWord.ActiveDocument.PrintPreview
I don't know if there would be such parameter we could pass in PrintPreview to do that.