loWord.Visible=.T. loWord.ActiveDocument.PrintPreview #DEFINE nLimitation 300 i = seconds() do while loWord.PrintPreview AND seconds()-i<=nLimitation && loop until we're in the print &&preview mode or time limitation reached WAIT WINDOW 'Please close the Word Preview to continue...' TIMEOUT 10 enddo loWord.ActiveDocument.CLose.....No idea how to lock the VFP main window to do not appear. Try to set _VFP.AutoYield to .F., however, this could not help - Windows manage each window anyway. For example, you can minimize all Windows by "Show Desktop" icon despite some application lockes and window is configured to do not ever minimize. this even hides all dialog boxes. So I guess more simple and better is just show message to users as I did in my applications when working with Word.
>>DECLARE integer Sleep in Win32API integer >>loWord.Visible=.T. >>loWord.ActiveDocument.PrintPreview >>#DEFINE nLimitation 300 >>i = 1 >>do while loWord.PrintPreview AND i<=nLimitation && loop until we're in the print >> &&preview mode or time limitation reached >> sleep(1000) >>enddo >>loWord.ActiveDocument.CLose..... >>..... >>>