Link to home
Start Free TrialLog in
Avatar of ssorrell
ssorrell

asked on

Printing attachments with their respective messages in Outlook

Hello,

We are trying to print several hundred emails from a folder in Outlook.  Several of these emails contain attachments.  When we print with the option to print attachments, the messages print, then the attachments print afterward.

Is there a way to have the attachments print directly after the message to which they were attached?

Thanks!
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, ssorrell.

Not through any setting I'm aware of.  If you don't mind using a script to print the messages, then we can print the messages and attachments together.  I'll be glad to post the script and instructions if a script is an option.
Avatar of ssorrell
ssorrell

ASKER

Thanks BlueDevilFan!  I've never gone that route before, but considering the volume of printing that is required for this, I think the customer would be open to anything.  I'd be happy to try out anything you can suggest :)
ASKER CERTIFIED SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Well, it *kind of* worked.  What I saw was that the time to launch the applications associated with the attachments messed things up.  Granted, the attachments did not come out at the very end, as with Outlook's own process, but the best that happened was that the attachments were *near* the messages they came from.

Also, a peculiar thing was happening with the PDF attachments.  When Acrobat went to open them, it came back with an error stating that the file did not exist.  I wonder if the delete step in the macro was occurring before Acrobat had a chance to open the file?

Do you have any ideas for changes to the code in light of what I ran into?  I actually tried a couple of Outlook plug-ins, too, and interestingly enough, the same problem occurred, with the application launch delay screwing things up.  I guess we chalk this up to another Microsoft function that needs revision, but which no one has ever addressed :)
I tried the above macro and it only printed the first attachment out of 10. Is there a way to include code in the macro which will allow me to print all 10 attachments? Thanks.

Keith
I had the same problem with the macro not printing all the documents before killing the other item.  I solved it by removing the kill line in the macro -this means you'll need to do an additional step to delete the files in the temp directory after it's all done.  I also took out the part for printing the message because all I wanted were the attachments printed.  seems to work fine.
here's the code I added to automically delete the files in the temp directory after printing.  I added the set statement after the existing set statement and the delete statement right before the endsub. Works like a champ.
Set fso = CreateObject("Scripting.FileSystemObject")
fso.DeleteFile "c:\temp\*.tif", True