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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

call a shell & print records

Status
Not open for further replies.

hefly

Technical User
Feb 6, 2008
134
US
How do you call a shell and print a record?

I can create a bat file and print from the following string.
I would like to create a macro or VBA to do the same from within access.

My bat path:

Code:
"C:\program files (x86)\irfanview\i_view32.exe" U:\D75\D750310*.tif /print
"C:\program files (x86)\irfanview\i_view32.exe" U:\D77\D770127*.tif /print
"C:\program files (x86)\irfanview\i_view32.exe" U:\D78\D780595*.tif /print

I am generating the path and string in a query with field name, PrintDocs.

I am copying the column and pasting the field into a bat file to print. I'd really like to run it from a macro, but I can't get a handle on it.

Thanks.

Hefly
 
A starting point in VBA:
Code:
strProg = """C:\program files (x86)\irfanview\i_view32.exe"""
strFile = "U:\D75\D750310*.tif"
strOption = " /print"
Shell strProg & " " & strFile & strOption

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top