Solved

VBscript or SSIS - send document to specific printer

Posted on 2011-03-07
3
235 Views
Last Modified: 2014-01-01
Problem:  I need to send an excel report directly to a specific printer when the report completes.

Using either SSIS or VBscript, what is the best way to do this?

a) the report runs in SSIS in SQL Server 2008
b) the report is exported to Excel

Thank you.
0
Comment
Question by:Brugge2
3 Comments
 
LVL 65

Accepted Solution

by:
RobSampson earned 500 total points
ID: 35062287
Hi, it sounds like the report has a macro to "complete" it, so add this on the end:

strOriginalPrinter = Application.ActivePrinter
strNewPrinter = "the new printer name"
Application.ActivePrinter = "strNewPrinter"
ActiveSheet.PrintOut
Application.ActivePrinter = strOriginalPrinter

Regards,

Rob.
0

Featured Post

Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Question has a verified solution.

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

If you have heard of RFC822 date formats, they can be quite a challenge in SQL Server. RFC822 is an Internet standard format for email message headers, including all dates within those headers. The RFC822 protocols are available in detail at:   ht…
When you see single cell contains number and text, and you have to get any date out of it seems like cracking our heads.

828 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