COM インターフェイスが必要です。トレイを変更するための Python コードは次のとおりです。VB は同じ基本手順に従います。
import win32print
PRINTER_DEFAULTS = {"DesiredAccess":win32print.PRINTER_ALL_ACCESS}
pHandle = win32print.OpenPrinter('PRINTERNAME', PRINTER_DEFAULTS)
properties = win32print.GetPrinter(pHandle, 2) #get the properties
pDevModeObj = properties["pDevMode"] #get the devmode
pDevModeObj.DefaultSource = tray_three #change some sort of setting... this case is the tray
properties["pDevMode"]=pDevModeObj #write the devmode back to properties
win32print.SetPrinter(pHandle,2,properties,0) #save the properties to the printer
もちろん、vba in word を使用してプリンターの設定を変更することもできます。エクセルやその他のオフィス製品を使用している場合は動作しません。