Printing via application (Access) and Shell

  • Thread starter Thread starter Fly Girl
  • Start date Start date
F

Fly Girl

I have an app on Access 2002 to SQL Server 2000 that runs
fine in a normal client server context. However, since
some users have moved to a Terminal Server setup we're
having trouble with printing. Users are in 4 different
physical locations.

The original app used Shell and the 'print' verb or the
file's native app to send files to the printer. Normally
the user would request all files associated with a parent
record which could be 0 to 50 files. The types range
from .doc, .xls, .pdf and .snp.

For the .doc and .xls I use the native app to print the
files--it was more fail-safe than Shell. These files still
print just fine on the intended printer for the Terminal
Server users.

However, the .pdf and .snp files that I print through
Shell are misbehaving. If the user opens just one file and
sends it to print, everything is fine but when I automate
printing the whole lot of related files, only the .doc
and .xls files print.

Seems that one issue is that Acrobat Reader and Snapshot
Viewer need to find out what printer to use (all necessary
printers are available from Terminal Server). So, I tried
to use 'printto' with Shell but cannot get that one to
actually work at all under any circumstances.
Note: 'printto' is available in the registry for the
required apps. Code used is: lngHWnd = ShellExecute
(0, "printto", "c:\1Snap\test1.pdf", "HPLJ8000DN",
vbNullString, 1) where the file is test1.pdf and the
printer name is "HPLJ8000DN".

I'm now looking for another way to solve this issue.
Anyone successfully printing apps via VB/VBA in a terminal
server setup?

Also, does Application.Printers.DeviceName work for
getting the users default printer?

Thanks for your help!
 
I had to talk with one of our print redirection testers on this, as I
am not an expert. Here's what he says:

On XP/WS03, one can use the WMI solution. WMI is scriptable. Windows
installs a few sample printing VB scripts in %systemroot%\system32,
called prn*.vbs

If you need it to work on W2k as well, there's a resource kit tool
called PrnAdmin. The thing is that this tool has to be present and
registered on every machine where it's used.


I have an app on Access 2002 to SQL Server 2000 that runs
fine in a normal client server context. However, since
some users have moved to a Terminal Server setup we're
having trouble with printing. Users are in 4 different
physical locations.

The original app used Shell and the 'print' verb or the
file's native app to send files to the printer. Normally
the user would request all files associated with a parent
record which could be 0 to 50 files. The types range
from .doc, .xls, .pdf and .snp.

For the .doc and .xls I use the native app to print the
files--it was more fail-safe than Shell. These files still
print just fine on the intended printer for the Terminal
Server users.

However, the .pdf and .snp files that I print through
Shell are misbehaving. If the user opens just one file and
sends it to print, everything is fine but when I automate
printing the whole lot of related files, only the .doc
and .xls files print.

Seems that one issue is that Acrobat Reader and Snapshot
Viewer need to find out what printer to use (all necessary
printers are available from Terminal Server). So, I tried
to use 'printto' with Shell but cannot get that one to
actually work at all under any circumstances.
Note: 'printto' is available in the registry for the
required apps. Code used is: lngHWnd = ShellExecute
(0, "printto", "c:\1Snap\test1.pdf", "HPLJ8000DN",
vbNullString, 1) where the file is test1.pdf and the
printer name is "HPLJ8000DN".

I'm now looking for another way to solve this issue.
Anyone successfully printing apps via VB/VBA in a terminal
server setup?

Also, does Application.Printers.DeviceName work for
getting the users default printer?

Thanks for your help!

This posting is provided "AS IS" with no warranties, and confers no rights
 
Back
Top