Hi,
See thread #
528482, message #
530120. This solved it for me!
HTH
Kevin
>Hi,
>
>When I want a PrintPreview of a MS-Excel worksheet I do this:
>
>loExcel = createobject("Excel.Application")
>loExcel.WorkBooks.Open("Test.Xls")
>loExcel.Visible = .t.
>loExcel.ActiveWindow.SelectedSheets.PrintPreview
>loExcel.Quit
>
>Then, after I see the preview, I click on Close buttom, and only after this the Quit line will be processed. It´s all right, here!
>
>
>But with a MS-Word documento I do:
>
>loWord = createobject("Word.Application")
>loWord.Documents.Open("Test.Doc")
>loWord.Visible = .t.
>loWord.Documents.ActiveDocument.PrintPreview
>loWord.Quit
>
>Here´s the problem: I can´t view because there isn´t pause between the .PrintPreviw line and the .Quit line.
>
>How can I force it to wait?
>
>Thanks.