?
Solved

Send a single word dockument to multiple printers

Posted on 2003-03-20
7
Medium Priority
?
304 Views
Last Modified: 2008-03-17
I have an application that builds word docs with a predefined template.
Inside the template are bookmarks that are populated with information taken from a SQL database at the time the document is generated.

My customer is requesting that we print this output twice - once to a printer in sales and once to a printer in shipping.

The single doc prints fine. I just need this to print to 2 different printers from a single generation.
We are using Word 2000
HP 4100
HP 8000DN
0
Comment
Question by:pattersonr
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
7 Comments
 
LVL 9

Accepted Solution

by:
pauloaguia earned 150 total points
ID: 8177363
File -> Print -> (Choose HP 4100)
File -> Print -> (Choose HP 8000DN)

Simple, no? :)


Now seriously. I think this macro in the ThisDocument module will do the trick:

Sub printTwo()
    Application.ActivePrinter = "HP 4000"
    ThisDocument.PrintOut Background:=True, Range:=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, PageType:=wdPrintAllPages
    Application.ActivePrinter = "HP 8000DN"
    ThisDocument.PrintOut Background:=True, Range:=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, PageType:=wdPrintAllPages
End Sub

Hope this helps

Paulo
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8177365
(or any other module fot that matter)
0
 
LVL 1

Author Comment

by:pattersonr
ID: 8177783
Paul...Cannot get macro to work from template.
I am assuming that macro is not working due to the fact that the macro is placed in the template.  When The information is populated into the template it then becomes a new document based on that template.  Then the document that is created is printed and saved.

I think that the macro is not working due to the fact that the macro does not carry through to the new document that is created.  Any other suggestions...or ways to carryover the macro to the new document. ???
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 22

Expert Comment

by:Dreamboat
ID: 8177844
Yep. Prolly need "activedocument" dontcha?

Patterson: I think you could easily record this macro, and when you go to do so, store it in the template, no?
0
 
LVL 1

Author Comment

by:pattersonr
ID: 8465103
Got the code that I was looking for.  I had to make several changes.  But, this was what put me on the right track
0
 
LVL 9

Expert Comment

by:pauloaguia
ID: 8465218
Thanks for the points. I must appologize for not replying to you (I don't remember why but I'm sure there was a good reason). Glad you could make it on your own just the same :)
 
Also maybe you could post the code you got. It may help someone else with a similar problem in the future.

Paulo
0
 
LVL 1

Author Comment

by:pattersonr
ID: 8465904
Public doPrint As Boolean

Public Sub printSecond()


    Application.ActivePrinter = "Acctg8000DN"
    Application.ActiveDocument.PrintOut Background:=True, Range:=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, PageType:=wdPrintAllPages
    Application.ActivePrinter = "Acctg8000DN"
    Application.ActiveDocument.PrintOut Background:=True, Range:=wdPrintAllDocument, Item:=wdPrintDocumentContent, Copies:=1, PageType:=wdPrintAllPages

End Sub

Private Sub Document_New()
    doPrint = True
End Sub

Private Sub Document_Open()
    doPrint = False
End Sub

Private Sub Document_Close()
    If doPrint Then
        Call printSecond
    End If
End Sub

We also added in a timer to delay the printing of the second document. However, we felt that this wasnt realy helping anything so we took it out.  This particular code was added so that when a user opened a saved copy that it did not reprint.  Hope this helps someone
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
New style of hardware planning for Microsoft Exchange server.
Learn how to create and modify your own paragraph styles in Microsoft Word. This can be helpful when wanting to make consistently referenced styles throughout a document or template.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

764 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question