[AccessD] Changing Printer

Eric Barro ebarro at verizon.net
Thu Apr 5 09:21:13 CDT 2007


Yes the code simply outputs the JPG image. You will need code to display it
for your user. 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Thursday, April 05, 2007 7:10 AM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Eric:

A redundant thanks again, Eric.  I got the terse reply from my client this
A.M. "Got it. It works. Good job Rocky!" 

I pasted your snip into my code commented out in case he ever comes up with
the requirement.  I assume that the code will create the jpg but not display
it.  You have to trigger the display yourself?

Best regards,

Rocky


 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Wednesday, April 04, 2007 5:08 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Rocky,

You're welcome!

Here's a snippet of code you might be interested in. You can provide a JPG
preview of the label before your client prints it. :)

//export the labelformat image to a JPG file newFile =
btFormat.FileName.Replace(labelFormatPath, labelFormatExportPath);
btFormat.ExportToFile(newFile.Replace(".btw", ".JPG"), "JPG" ,
BarTender.BtColors.btColors24Bit,
BarTender.BtResolution.btResolutionPrinter,
BarTender.BtSaveOptions.btSaveChanges);

The code is in C#. Minor mods needed for the replace syntax since in VB this
is a function instead of a method.

Eric 

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Wednesday, April 04, 2007 4:51 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Excellent!  That's too easy.  I didn't know there was a printer parameter on
the .Open but I see it now - I just have it as a "" string. I already put a
combo box on the form with the installed printers and save the selection in
a front end preferences table.

Thank you.  

 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Eric Barro
Sent: Wednesday, April 04, 2007 3:41 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Rocky,

LOL! Guess what...I have a web-based app developed in C# that calls
Bartender.exe as a COM object. I provide the default printer in code this
way...

btFormat = btApp.Formats.Open(labelFormatFileName, false, labelPrinter)

Where labelFormatFileName and labelPrinter are string values.

Since you don't know the printer name you can simply present him with a
select printer form that pulls up all available connected printers and then
pass the value from the combobox to your function so that it passes it on to
the labelPrinter variable.

Eric

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of Rocky Smolin at
Beach Access Software
Sent: Wednesday, April 04, 2007 3:32 PM
To: 'Access Developers discussion and problem solving'
Subject: Re: [AccessD] Changing Printer

Actually, I just reviewed the code.  It's not a report.  It's a bunch of
calls to an object.  Bartender (cute, huh) is the name of the program and I
call it from inside the form.

Code snip:

        Set btFormat = btApp.Formats.Open(Me.fldFABLabelFile, False, "")

        btFormat.SetNamedSubStringValue "Part No. (P)", Me.fldFABPartNumber
        btFormat.SetNamedSubStringValue "Quantity",
Me.fldContainerTotalPieces
        btFormat.SetNamedSubStringValue "OrderNumber", Me.cboJobs.Column(1)
        btFormat.SetNamedSubStringValue "ContainerNumber",
Me.fldContainerContainer
        btFormat.SetNamedSubStringValue "Serial", Me.fldContainerID
        btFormat.SetNamedSubStringValue "PO #",
Nz(Me.fldJobsEndCustomerPONumber)
        btFormat.SetNamedSubStringValue "LOT #", strVendorLot
        btFormat.SetNamedSubStringValue "Quantity Identifier", "Q"
        btFormat.SetNamedSubStringValue "R#",
Nz(Me.fldFABEngineeringChangeNumber)
        btFormat.SetNamedSubStringValue "EngineeringChangeNumber",
Nz(Me.fldFABEngineeringChangeNumber)
       
        btFormat.PrintOut False, False

So I need to change the default printer and then change it back again.  I
used to have some code somewher to do this but can't find it.

Rocky





 	
	

-----Original Message-----
From: accessd-bounces at databaseadvisors.com
[mailto:accessd-bounces at databaseadvisors.com] On Behalf Of William Hindman
Sent: Wednesday, April 04, 2007 2:48 PM
To: Access Developers discussion and problem solving
Subject: Re: [AccessD] Changing Printer

...I use the "Select specific printer" option in the report set-up ...that
report always uses the selected printer and the rest use the default ...if
the bar-code printer is not available for some reason, the user will get a
pop-up dialog asking if they want to select another printer.

William Hindman

----- Original Message -----
From: "Rocky Smolin at Beach Access Software" <rockysmolin at bchacc.com>
To: "'Access Developers discussion and problem solving'" 
<accessd at databaseadvisors.com>
Sent: Wednesday, April 04, 2007 4:27 PM
Subject: [AccessD] Changing Printer


> Dear List:
>
> I have a client who installed a bar code printer.  If he makes it the 
> default printer that screws up all of this print previews on other 
> reports.
>
> So I'd like to change the default printer from inside the form that 
> prints the bar code labels and change it back to the default when done.
>
> Does anyone know of or have a code snip that does this?
>
> MTIA,
>
> Rocky
>
>
> Rocky Smolin
>
> Beach Access Software
>
> 858-259-4334
>
> www.e-z-mrp.com
>
>
>
> www.bchacc.com
>
>
>
>
>
> --
> AccessD mailing list
> AccessD at databaseadvisors.com
> http://databaseadvisors.com/mailman/listinfo/accessd
> Website: http://www.databaseadvisors.com
> 



--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 4/3/2007
12:48 PM
 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/744 - Release Date: 4/3/2007
5:32 AM
 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 4/3/2007
12:48 PM
 

--
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

--
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/744 - Release Date: 4/3/2007
5:32 AM
 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.25/745 - Release Date: 4/3/2007
12:48 PM
 

-- 
AccessD mailing list
AccessD at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/accessd
Website: http://www.databaseadvisors.com

-- 
No virus found in this incoming message.
Checked by AVG Free Edition.
Version: 7.5.446 / Virus Database: 268.18.26/746 - Release Date: 4/4/2007
1:09 PM
 




More information about the AccessD mailing list