Problems with a shell command (print) in VBA

Y

Yonah Sudwerts

I apoligize if this is the wrong place to ask this, but since I started my
project with you guys, I'll hopefully finish it here.

Here is the situation, My script has this defined:

And the Calling Line is:

OK, I should note the file I am trying to print (which was an attachment) is
a .TIF file. On my computer when I checked the File Type properties, I had
both the "open" and "print" command, and the script works perfectly, just to
note the command line in the properties of the file is: "C:\Program
Files\Common Files\Microsoft Shared\MODI\11.0\MSPVIEW.EXE" /p "%1"
The problem is that when I used the script on the computer that it needs to
run on, the following problem comes up: (I will ignire the
mailitem.sendername problem that I got around with Redemption :)
First off the Print command was not set up on the properties for TIF files,
so I simply copied exactly what my computer (which works) said (obviously
using the correct path to the file.
The computer when it hits the print line in the script opens the TIF file in
Microsoft Image and Fax Viewer, whic is not even the program that is
supposed to open it, and stops, no peint no nothing.
Just to add, If I Double-Click on the same TIF file it opens in Microsoft
Office Document Imaging.

I am running Office 2003 on Windows XP Pro. He is running Office XP (2002)
on Windows XP Home.
I can not think of any other info that would matter to you.
If anyone can try and help me,(which isn't easy, since I have to think of
different possibilities and then only test them when I have access to his
computer) or if not, please try and direct to a NG that might be able to
help.

TIA,
Yoni
 
K

Ken Slovak - [MVP - Outlook]

ShellExecute would rely on the "print" verb having been defined on that
computer for that file type. If no verb has been defined then the print will
fail. You will need to define that verb on that computer, using the
application that is available. Use the path to Document Imaging.
 
Y

Yonah Sudwerts

I did that, I created a print command on the other computer, making it look
exactly like the one that is on my computer (where the script works).
 
Y

Yonah Sudwerts

If I can not get it to work this way, do you have any ideas on another way
to print the file?
 
K

Ken Slovak - [MVP - Outlook]

You could use Word and load the file in Word and call Word's print methods,
you could load the file into any app that can handle a TIFF file and print
using it's print method (assuming the app can be automated).
 
Y

Yonah Sudwerts

Is there somewhere I can look for ways on how to automate the prinintg on
certain programs? I see that it opens in the MS Image and Fax Viewer (which
I learned is a dll file, and not an exe) but I ahve no clue on any command
line print options for such programs?

Anything you can give me (or another place to inquire would be greatly
appreciated.

Yoni
 
K

Ken Slovak - [MVP - Outlook]

There's nothing really I can give you. Each program may or may not accept
command line arguments and/or being automated. You'd have to research any
program you are considering using. There's a ton of information about
automating Word and Excel in the MS KB and in all those Word and Excel
newsgroups. You're also dependent on what programs are installed on any
specific computer, and there's no way I can know that.
 
Joined
Sep 1, 2008
Messages
1
Reaction score
0
Its been a long time and I am the oringal questioner.
Something I got then, I do not now how to do now.
You said:
ShellExecute would rely on the "print" verb having been defined on that
computer for that file type. If no verb has been defined then the print will
fail. You will need to define that verb on that computer, using the
application that is available. Use the path to Document Imaging.


and I said, I did it, well now, I am on a new Vista computer and I acn not remember how to do it.
Please help.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top