Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Printing Two Docs in Word from VB
Message
 
À
12/04/1999 12:30:56
Information générale
Forum:
Visual Basic
Catégorie:
Autre
Divers
Thread ID:
00207480
Message ID:
00207657
Vues:
21
>The following error occurs when printing the second document when I am running the compiled (EXE) version of the program.
>"Windows cannot print due to a problem with the current printer setup
>try one or more of the following " plus some bullshit suggestions ...including "reinstall the printer driver. 5142"
>It prints the first document fine.
>
>Here is the code:
>dim appwd as word.application
>dim appdoc as word.document, appdoc2 as word.document
>set appwd = new word application
>set appdoc = appwd.documents(file1)
>appwd.activedocument.printout()
>appwd.activedocument.close
>
>'call 5 second delay to let word do its thing
>
>set appdoc2 = appwd.documents(file2)
>appwd.activedocument.printout()
>appwd.activedocument.close
>
>'call another delay to let word close out its print buffer
>
>set appdoc = nothing
>set appdoc2 = nothing
>appwd.quit
>set appwd = nothing
>
>It works fine when run from within VB.

I remember having this problem sometime ago. If I remember well, setting the Background property to False helped me a lot.

Try this: appwd.activedocument.printout Background:=False
Éric Moreau, MCPD, Visual Developer - Visual Basic MVP
Conseiller Principal / Senior Consultant
Moer inc.
http://www.emoreau.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform