Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Word Template - Tray ID issue

Posted on 2006-06-21
8
Medium Priority
?
604 Views
Last Modified: 2012-08-14

I have two type of printers in my company. HP4300TN and HP4350TN.

We have a number of word 2000 templates which work fine with the 4300TN, whereby when a user prints it automatically defaults to letterhead paper as specified in the paper source tab in the page setup.

My problem occurs when my default printer is set to the 4350TN printer. The word template changes the paper source to Light 60-75 g/m2.  So when the user prints, the printer freaks out as it cannot find the Light Tray as the tray is configured to letterhead.

After doing some research I found out that the problem lies in the tray ID. On the HP 4300 the letterhead paper type is set to id: 1265 and on the 4350 the light paper has the same id of: 1265. So when you change printers from 4300 to 4350 the word template changes the paper source from letterhead to light and vice versa.

How can I resolve this issue? Is it possible to add a VBA script to the template saying:
If your printer is a 4300 change the paper source to letterhead or tray id:1265
If you printer is a 4350 change the paper source to letterhead or tray id:1271 (NOT 1265, which is what it is doing now)

Anyone can help.

Thanks
0
Comment
Question by:Priscilla_Hora
  • 4
5 Comments
 
LVL 76

Accepted Solution

by:
GrahamSkan earned 2000 total points
ID: 16958233
You can change the printer trays with a macro like this. You need to change both first and other pages tray.

The main problem is when to run this. Most situations would be covered if call it from the Document_Open and Document_New events in ths ThisDocument module of your template. However if you are likely to change printers after that has happened, it might get a bit more complicated.

Sub PrinterTrays()
Dim strPrinterName As String

strPrinterName = Application.ActivePrinter
With ActiveDocument.PageSetup
    If InStr(1, strPrinterName, "HP4300TN", vbTextCompare) Then
        .FirstPageTray = 1265
        .OtherPagesTray = 1265
    Else
    'next line not needed if there are only two printer types
    'If InStr(1, strPrinterName, "HP4350TN", vbTextCompare) Then '
        .FirstPageTray = 1271
        .OtherPagesTray = 1271
    'End If
    End With
End Sub
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16958284
Your next question here:
http://www.experts-exchange.com/Programming/Programming_Languages/Visual_Basic/Q_21895174.html
looks like the same question, but worded differently.

As far as I can see the, the answer would be the same as for this one.
You are not allowed to offer more than 500 points for the same question. However you while it has no comments you would be able to delete it yourself.

If you think it's essentially a different question, perhaps you could add a comment explaining the differnce that so that an expert can address that different question.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16958330
Hmm, it seems that you have also posted this question in the Word area:
http://www.experts-exchange.com/Applications/MS_Office/Word/Q_21895137.html

and that gBhari has given a similar answer.

I think we'll have to wait and see if the moderators come across it and let them sort it out.
0
 

Author Comment

by:Priscilla_Hora
ID: 16964746
Where would I put the code in so that it automatically checks which printer is connected upon opening the template?
I don't want this to be a button where a user clicks on, this process has to be invisible to the user.
0
 
LVL 76

Expert Comment

by:GrahamSkan
ID: 16966623
Put these calls in the ThisDocument Module of your template:

Private Sub Document_New()
    PrinterTrays
End Sub

Private Sub Document_Open()
    PrinterTrays
End Sub
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

When designing a form there are several BorderStyles to choose from, all of which can be classified as either 'Fixed' or 'Sizable' and I'd guess that 'Fixed Single' or one of the other fixed types is the most popular choice. I assume it's the most p…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

783 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