Hello,
I've made a macro which scrapes information from Extra! Attachmate. The information is then printed onto a form which is located in one of three trays in a printer. One of the pieces of information is the person's language (Ex. 'English', 'French', 'Spanish'), and this information is stored in abreviation form, such as 'EN', 'FR' and 'SP'.
From what I've read, the easiest way to have a macro print to a specific tray is to create a separate printer for each tray and then change the default printer depending on the tray needed.
I have 3 .INF files set up which contain network printer addresses and I use the following code to get the macro to select the printer depending on the language, so for the sake of time and space, I'll include the code for the English part:
The English .INF contains:\\SERVER1\Lexmark [highlight]on Ne03:[/highlight]
And the code goes like this:
My problem is with the printer name itself. You'll notice that the printer name has a "on Ne03:" at the end. This seems to change from time to time depending on the computer it is being used on. Does anyone know how to standardize this, or to simply remove it?
Thanks for your help.
dvirgint
I've made a macro which scrapes information from Extra! Attachmate. The information is then printed onto a form which is located in one of three trays in a printer. One of the pieces of information is the person's language (Ex. 'English', 'French', 'Spanish'), and this information is stored in abreviation form, such as 'EN', 'FR' and 'SP'.
From what I've read, the easiest way to have a macro print to a specific tray is to create a separate printer for each tray and then change the default printer depending on the tray needed.
I have 3 .INF files set up which contain network printer addresses and I use the following code to get the macro to select the printer depending on the language, so for the sake of time and space, I'll include the code for the English part:
The English .INF contains:\\SERVER1\Lexmark [highlight]on Ne03:[/highlight]
And the code goes like this:
Code:
'STDprinter = Application.ActivePrinter
'If tpLang = "EN" Then
' ConfigFile$ = "T:\SERVER\\Macros\Printer1.inf"
' If Dir$(ConfigFile$) <> "" Then
' Open ConfigFile$ For Input As #1
' Line Input #1, PrinterName$
' Close #1' Application.ActivePrinter = PrinterName$
' Else
' STDprinter
' End If
' Worksheets("Print").Select
' ActiveSheet.PageSetup.PrintArea = "$A$1:$AL$28"
' ActiveSheet.PrintOut
'Elseif
' [i]code for French and Spanish go here[/i]
'End If
'Application.ActivePrinter = STDprinter
'Workbooks("INNS.xls").Close SaveChanges:=False
My problem is with the printer name itself. You'll notice that the printer name has a "on Ne03:" at the end. This seems to change from time to time depending on the computer it is being used on. Does anyone know how to standardize this, or to simply remove it?
Thanks for your help.
dvirgint