OberonPlace.com Forums  

Go Back   OberonPlace.com Forums > Developer Forums > VBA > CorelDRAW/Corel DESIGNER VBA

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 25-01-2005, 14:53
Anonymous
Guest
 
Posts: n/a
Default Redirect printout to different printers

Hey guys, I'm creating an application in Access to automatically get data from a public SQL server and, once it's processed, distribute it to 3 different printers and run a report in a 4th one.
There is no user intervention unless paper is out or so and selecting printer is going to be data driven.
So far I can't find a way to change the default printer (unless showing the print dialog which is stupid since there will be no user intervention), every property i've found is read-only. Any ideas???
In the mean time I'll keep looking, may be I'll catch the answer before browse back here.
Thanks
:idea: CyDev :idea:
Reply With Quote
  #2  
Old 28-04-2005, 11:15
ddonnahoe's Avatar
ddonnahoe ddonnahoe is offline
Senior Member
 
Join Date: Jan 2004
Location: Louisville, KY
Posts: 552
Send a message via ICQ to ddonnahoe Send a message via AIM to ddonnahoe Send a message via MSN to ddonnahoe Send a message via Yahoo to ddonnahoe
Default

Here is what I use. It is based on having twon checkboxes in the form, but you could probably do without those...

Code:
' Set Printer
    If SendToColor.Value = True Then
        Dim prn1 As Printer
        Dim n As Long
    
        Set prn1 = Nothing
        For n = 1 To Printers.Count
           If Printers(n).Name = "hp deskjet 5550 series" Then
                Set prn1 = Printers(n)
                Exit For
            End If
        Next n
    
        If prn1 Is Nothing Then
            MsgBox "Printer not found", vbCritical
        Else
           Set ActiveDocument.PrintSettings.Printer = prn1
           ActiveDocument.PrintSettings.Copies = 1
        End If

        ActiveDocument.PrintSettings.Copies = 1
        ActiveDocument.PrintSettings.PageRange = "1"
        ActiveDocument.PrintOut
    End If
    
    If SendToLaser.Value = True Then
        Dim prn2 As Printer
        Dim j As Long
    
        Set prn2 = Nothing
        For j = 1 To Printers.Count
           If Printers(j).Name = "GCC Elite XL 20/600 v3.31" Then
                Set prn2 = Printers(j)
                Exit For
            End If
        Next j
    
        If prn2 Is Nothing Then
            MsgBox "Printer not found", vbCritical
        Else
           Set ActiveDocument.PrintSettings.Printer = prn2
           ActiveDocument.PrintSettings.Copies = 1
        End If

        ActiveDocument.PrintSettings.Copies = 1
        ActiveDocument.PrintSettings.PageRange = "1"
        ActiveDocument.PrintOut
    End If
__________________
Sean
Waiting for a ride in the T.A.R.D.I.S.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Select different printers in VBA Anonymous General 2 02-02-2005 17:14


All times are GMT -5. The time now is 03:47.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright © 2011, Oberonplace.com