Print multiple tif files using VBA

Bruno_x

Active Member
Joined
Feb 17, 2002
Messages
491
Once a week I need to print multiple (from 2 to 75 and more) tif files stored on my HD

The files are all named in this way : xxxxx-yy.tif
where xxxxx is a 5 character number and y is the pagenr.
example : 01254-1.tif, 01254-2.tif,..., 01254-12.tif


For the moment I use some VBA code to filter the tif-names, I import the selected files and print them. (=quite slow)

My question : is there a way to print the files directly to the printer instead of import & print ?

I'm looking for an alternative in VBA for this : http://www.anzio.com/support/documentation/printwizprog.htm
(this Print Wizard only prints text-based files)
 

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
After a few more hours try & error, I found this solution :

ShellExecute 0, "Print", "D:\Certif\01501-2.tif", "", "", 1
No, this is not the solution, this will let you view the tif file, not printing it ...

Can I use Shell ?
Is there a program that accept command line options ? and...
yes, IrfanView accept command line options and one of them is /print.

the next code will do the trick :
Shell "C:\Programs\IrfanView\i_view32.exe D:\Certif\01501-*.* /print", 1

Maybe this is usefull to someone else...
 
Upvote 0

Forum statistics

Threads
1,216,129
Messages
6,129,047
Members
449,482
Latest member
al mugheen

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top