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.
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.