PC freeze when printing ppt from VB

X

Xav

Hi all

I have an small program that automatically converts .doc, .xls or .ppt
documents into pdf documents using Visual Basic and the Acrobat
ditiller printer.
It works perfectly fine for doc and xls documents but for the ppt
documents I have a random PC freezing problem :-/

Sometimes, apparently randomly, my PC completely freeze at the moment
the powerpoint application is supposed to open the presentation to
print it.
The only way is to kill the powerpoint process, then the application
goes on converting the other documents, even ppt if there are others.

I have tested the application with Powerpoint XP and Powerpoint 97 and
the problem occurs with both versions.

I don't think it is caused by a conflict with previous converted
documents as i wait each time for the pdf to be created and copied
before trying to convert the following one.


Here is my code for the ppt opening and printing :

Set MyPowerPoint = CreateObject("powerpoint.application")

With MyPowerPoint

.Visible = True

.WindowState = ppWindowMinimized


' It frezzes between here

.Presentations.Open FileName:=PDFIn$

.ActivePresentation.PrintOut

' and here

.ActivePresentation.Close

End With


If anyone has an idea i would really be gratefull ^^

Xav.
 
S

Steve Rindsberg

' It frezzes between here

.Presentations.Open FileName:=PDFIn$

.ActivePresentation.PrintOut

' and here

.ActivePresentation.Close

By calling the .PrintOut method, you're accepting whatever the current printing
defaults are. For example, if PowerPoint's set to print To File, it will put
up a dialog box requesting the filename; this might be hidden behind another
window, so the app will appear to hang. Or Distiller might be set to request a
filename. Same problem.

Next time it freezes, use Alt+Tab to cycle among open windows; see if there's
one waiting for the user to type a file name.
 
X

Xav

Hi

Thanks for your response.
I don't think it comes from that point because most of the time
everyting works fine.
Before calling that procedure i set the default printer to the
distiller printer.
And all the Windows' printer settings have been modified to output the
file correctly.

I was rather wondering if there could be some kind of known problem
with the powerpoint print method when using it from VB...
I noted that, for example, it appears to be more likely to freeze when
i have Outlook Express running... This is the kind of weird problem I
have...

Anyway thaks again for your response.
 
S

Steve Rindsberg

Hi

Thanks for your response.
I don't think it comes from that point because most of the time
everyting works fine.
Before calling that procedure i set the default printer to the
distiller printer.
And all the Windows' printer settings have been modified to output the
file correctly.

OK. That wasn't clear from your post, but no problem, it is now.
I was rather wondering if there could be some kind of known problem
with the powerpoint print method when using it from VB...

Not that I know of, but that only proves that I don't know of it if there is one.
:)

Is there anything specific about the presentations that cause freezes? Some types
of PPT content can create very big PS and PDF files; it may look like PPT and/or
Distiller have frozen when in fact they're just chugging along slowly.

I noted that, for example, it appears to be more likely to freeze when
i have Outlook Express running... This is the kind of weird problem I
have...

Anyway thaks again for your response.



By calling the .PrintOut method, you're accepting whatever the current printing
defaults are. For example, if PowerPoint's set to print To File, it will put
up a dialog box requesting the filename; this might be hidden behind another
window, so the app will appear to hang. Or Distiller might be set to request a
filename. Same problem.

Next time it freezes, use Alt+Tab to cycle among open windows; see if there's
one waiting for the user to type a file name.

-----------------------------------------
Steve Rindsberg, PPT MVP
PPT FAQ: www.pptfaq.com
PPTools: www.pptools.com
================================================
[/QUOTE]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top