[AccessD] Wait For Word To Finish Printing

Andy Lacey andy at minstersystems.co.uk
Wed Nov 10 09:12:17 CST 2004


Vlad
I know the problem. What I did, rightly or wrongly, was omit the .Quit but
still set the Word object to Nothing.
--
Andy Lacey
http://www.minstersystems.co.uk



--------- Original Message --------
From: Access Developers discussion and problem solving
<accessd at databaseadvisors.com>
To: Access Group E-mail <accessd at databaseadvisors.com>
Subject: [AccessD] Wait For Word To Finish Printing
Date: 10/11/04 15:58

>
> Guys,
>
> I have a function that prints out numerous Word documents on the fly which
I loop through. The problem is the print job hasn't finished and a dialogue
box pops up suggesting that "If you close word now the document print
job will be cancelled"
>
> The code is as follows:
>
>     With m_objWord
>         .ActiveDocument.SaveAs strWrdPath
>
>         If gBoolPrintOrNot = True Then
>             .ActiveDocument.PrintOut
>             DoEvents
>         End If
>
>         .ActiveDocument.Close
>     End With
>
>     m_objWord.Quit
>     Set m_objDoc = Nothing
>     Set m_objWord = Nothing
>
> It works well other than I have to close after I am finished as I don't
want to leave variables in memory. Is there any way to wait until word has
finished it's job?
>
> I have tried Dev's "ShellWait" function, but that is more geared
to batch files rather than a windows app, and it's not the word document
that is the process, it's word that is executing the process....
>
> Any guidance much appreciated...
>
> Vlad
>
>
> --
> _______________________________________________
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
>
>
>
>
>
>

________________________________________________
Message sent using UebiMiau 2.7.2




More information about the AccessD mailing list