vba process status check 
Author Message
 vba process status check

I have created an Access DB to do mass conversions of MS
Word and MS PowerPoint files to Adobe Acrobat PDF files.  
It is working, but when it queues more than 3 files it
causes my Win98 PC to freeze.

Let me briefly explain what I am automating and how:

1) A Folder has MS Word or PowerPoint files in it to be
converted to Acrobat PDF.  Each type has its own folder,
and in that folder there are two subfolders - one
called "Processed" (where the orignal files are placed
after they have been converted) and one
called "PDFOutputs" (where the converted PDF files are
placed).

2) The Database is opened, which opens an autoexec form
(the DB Window is hidden from the user).  The user selects
which type of conversion they want done (either Word or
PowerPoint), which opens another form where the actual
automation occurs.

3) Two default folders are listed in text boxes (where the
Source files are and where the Acrobat Distiller converted
files are outputted to).  These are in text boxes to
facilitate if they needed to be changed on-the-fly (for
some odd reason).  The Destination folder is not where the
files will end up however, they are taken from Distiller's
folder and placed into a subfolder in the Source folder
(mentioned above as the "PDFOutput" folder).

4) Well, now to the VBA processes.  The VBA uses OLE to do
the following:
- start up Word (or PowerPoint),
- open the specific Word or PowerPoint file,
- change the ".ActivePrinter" to "Acrobat Distiller",
- print the file to the Distiller Printer,
- close the file,  
- copy the Source file to the "Processed" folder,
- delete the Source file from the Source folder,
- copy the Distiller PDF file from the Destination folder
to the "PDFOutput" folder,
- delete the Distiller Destination file,
- move to the next file in the Source folder.

5) The program works, but it hangs (freezes) when there
are more than 3 files sent to the Distiller Printer
(whether this is an issue with Distiller or Win98 Printer
Queues or MS Word I do not know).  Thus, I need a way to
either check the status of the Distiller process, or a
timer which waits a set amount of time.  Now I'd like to
check the status of Distiller, but I noticed an issue with
Task Manager in that it lists AcroDist as active even when
the process has finished (I only know this by watching the
Task Manager using CTRL-ALT-DEL and AcroDist still appears
even when the Acrobat emblem is out of the System Tray and
the process has finished).

6) However, I placed a Message Box to appear before the
files are copied and/or deleted asking the User to make
sure that the Acrobat symbol appears and then disappears
in the System Tray before clicking OK.  This solved the
problem, but I need the final solution to not require user
intervention for each file.  Thus, I need a way to check
the status of the AcroDist process.  Can anyone help with
this???

I would appreciate any help with this, as I have been
unfruitful looking online and in some books that we have.

Thanks in advance,

Colin

PS -- You can also reach me at colin chase at hotmail dot
com.



Sun, 01 Aug 2004 05:38:11 GMT  
 vba process status check
Hi Colin,
Just an idea but if you turn off 'background printing' in word or powerpoint
then it should wait for one document to prin before trying to proces the
next.

Geoff


Quote:
> I have created an Access DB to do mass conversions of MS
> Word and MS PowerPoint files to Adobe Acrobat PDF files.
> It is working, but when it queues more than 3 files it
> causes my Win98 PC to freeze.

> Let me briefly explain what I am automating and how:

> 1) A Folder has MS Word or PowerPoint files in it to be
> converted to Acrobat PDF.  Each type has its own folder,
> and in that folder there are two subfolders - one
> called "Processed" (where the orignal files are placed
> after they have been converted) and one
> called "PDFOutputs" (where the converted PDF files are
> placed).

> 2) The Database is opened, which opens an autoexec form
> (the DB Window is hidden from the user).  The user selects
> which type of conversion they want done (either Word or
> PowerPoint), which opens another form where the actual
> automation occurs.

> 3) Two default folders are listed in text boxes (where the
> Source files are and where the Acrobat Distiller converted
> files are outputted to).  These are in text boxes to
> facilitate if they needed to be changed on-the-fly (for
> some odd reason).  The Destination folder is not where the
> files will end up however, they are taken from Distiller's
> folder and placed into a subfolder in the Source folder
> (mentioned above as the "PDFOutput" folder).

> 4) Well, now to the VBA processes.  The VBA uses OLE to do
> the following:
> - start up Word (or PowerPoint),
> - open the specific Word or PowerPoint file,
> - change the ".ActivePrinter" to "Acrobat Distiller",
> - print the file to the Distiller Printer,
> - close the file,
> - copy the Source file to the "Processed" folder,
> - delete the Source file from the Source folder,
> - copy the Distiller PDF file from the Destination folder
> to the "PDFOutput" folder,
> - delete the Distiller Destination file,
> - move to the next file in the Source folder.

> 5) The program works, but it hangs (freezes) when there
> are more than 3 files sent to the Distiller Printer
> (whether this is an issue with Distiller or Win98 Printer
> Queues or MS Word I do not know).  Thus, I need a way to
> either check the status of the Distiller process, or a
> timer which waits a set amount of time.  Now I'd like to
> check the status of Distiller, but I noticed an issue with
> Task Manager in that it lists AcroDist as active even when
> the process has finished (I only know this by watching the
> Task Manager using CTRL-ALT-DEL and AcroDist still appears
> even when the Acrobat emblem is out of the System Tray and
> the process has finished).

> 6) However, I placed a Message Box to appear before the
> files are copied and/or deleted asking the User to make
> sure that the Acrobat symbol appears and then disappears
> in the System Tray before clicking OK.  This solved the
> problem, but I need the final solution to not require user
> intervention for each file.  Thus, I need a way to check
> the status of the AcroDist process.  Can anyone help with
> this???

> I would appreciate any help with this, as I have been
> unfruitful looking online and in some books that we have.

> Thanks in advance,

> Colin

> PS -- You can also reach me at colin chase at hotmail dot
> com.



Mon, 02 Aug 2004 00:01:39 GMT  
 vba process status check
After searching further on the Net I found a "Dev Ashish"
program at this site:

http://www.mvps.org/access/api/api0007.htm

This code allows my program to "know" if an Application is
running, even if "Not Visible" (which is how I have my
code set up).  It Works Awesome!!!  BUT...

How do I set up the "strClassName" for "Adobe Acrobat
Distiller"???

His code sets up the possible applications that are
running using a Case Statement, as in the following
example:

Select Case LCase$(strAppName)
    Case "excel":       strClassName = "XLMain"
    Case "word":        strClassName = "OpusApp"
    Case "access":      strClassName = "OMain"
    Case "powerpoint95": strClassName = "PP7FrameClass"
    Case "powerpoint97": strClassName = "PP97FrameClass"
    Case "notepad":     strClassName = "NOTEPAD"
    Case "paintbrush":  strClassName = "pbParent"
    Case "wordpad":     strClassName = "WordPadClass"
    Case Else:          strClassName = ""
End Select

Is "Dev Ashish" on this board???

I appreciated the code tremendously, but I need a little
more help.  Where do I find these "Classes" (as I would
never had guessed MS Word as a class called "OpusApp").  
I'd love to have a resource with these "program classes"
listed.

Colin



Mon, 02 Aug 2004 00:49:40 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Need help!! check process loading status

2. Check process status

3. Checking Word Mailmerge status from Access VBA

4. VBA Check and Option Check Boxes

5. Process Status ?

6. how to spawn process and get exit status

7. IIS/IE Http Status 304 processing

8. Please Help on status of a process

9. # Records processed in Crystal Status Bar

10. Number of records processed on crystal status bar

11. getting status of a win32 process

12. process status

 

 
Powered by phpBB® Forum Software