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

VBA Code to Print Infopath Attachments

Status
Not open for further replies.

Googleplexity

Programmer
Nov 30, 2011
5
US
Hello all,

I'm trying to have outlook print off my Infopath forms as they come in. Printing the body or using a rule doesn't really suit my need. I'm trying to avoid printing the BG color and images which is why I don't want to print the emails. There's a setting in IP that does what I need but I want the forms to be printed as I recieve them.

There are a few examples on the interwebs I've found dealing with printing attachments but they all deal with PDF's by calling Shell and opening a reader with some arguments. Sadly I don't think infopath supports a print arguement like /p (I may be wrong) or else I wouldn't be asking this question. So is there a way to print this form attachment from OL07 via IP07?



Thanks in advance

 
Have you tried something as simple as path.print? For example activworkbook.path gives the path to the activeworkbook.
 
Getting outlook to print an email is as simple as that yes, you can do it with MailItem.Print

However outlook will not explicitly print attachments and doing something like:
Code:
Shell """C:\Program Files\Adobe\Reader 8.0\Reader\acrord32.exe"" /h /p """ + FileName + """", vbHide

Will not work because Infopath doesn't support a print argument. If this was excel there wouldn't be much problem but the object model for outlook is a bit more restrictive than excel's in my opinion, and I don't even want to talk about Infopaths lol
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top