Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problems using objWord.Application.Options.DefaultTrayID

Status
Not open for further replies.

GaryHowe

IS-IT--Management
Nov 14, 2003
5
GB
I am developing a Microsoft Access system for a client that controls the printing of word documents to a Ricoh Aficio 2105 printer. Depending on parameters within the system a particular Input Tray Id is required (each tray has a different colour paper). To do this I used the Word application object to set the DefaultTrayId property to the required number (1 - 5) prior to using the .printout method (see example code below). I tested this at work(using an HP printer) and the method worked, however when running tests at the client site using their Ricoh printer all the prints were made from Tray number 1.

Global objWord As New Word.Application
.
Set objWord = CreateObject("Word.application")
.
.

DoCmd.SetWarnings False
objWord.Options.Pagination = False
objWord.Application.ScreenUpdating = False

objWord.Application.Options.DefaultTrayID = iRequiredTrayId
DoEvents
objWord.Application.PrintOut Background:=True, FileName:=strFile
DoEvents


‘Where iRequiredTrayId is set to a value from 1 to 5
‘and strFile contains the Word (.doc) file name.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top