MS Access VBA refresh printers in Application object
Posted on 2014-11-24
I have an MS Access application that I want to provision over remoteapp.
this works fine - but the problem I am having is with the printers.
I preset certain reports to use certain printers - and use the following code to get the printers that are available to the application:
If Printers.Count > 0 Then
' Get count of installed printers.
strMsg = "Printers installed: " & Printers.Count & vbCrLf & vbCrLf
' Enumerate printer system properties.
For Each prtLoop In Application.Printers
PrinterID = AddPrinter(.DeviceName, .DriverName, .Port)
strMsg = strMsg _
& "Printer ID: " & PrinterID & vbCrLf _
& "Device name: " & .DeviceName & vbCrLf _
& "Driver name: " & .DriverName & vbCrLf _
& "Port: " & .Port & vbCrLf & vbCrLf
strMsg = "No printers are installed."
this works fine
the problem that I have is that when the remoteapp session starts - not all the remote printers are immediately available to the remoteapp and so never appear in the list of printers accessible to the application.
if there a way to refresh this list of printers?
if I go to File.. Print - the remote printers eventually appear.