Open Attachment from Outlook 2003

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

When I receive an email with a word attachment, it would be nice if I could
run a macro that would...Open the word attachment, print the file, then close
word, and maybe the outlook window I used to open the file...that part I
don't have to have I guess.

I think I have it down except for the opening of the word doc from
Outlook...that's the tricky part!

Any ideas?

All your help is greatly appreciated.

Thank you
 
Tim, what is about my answer on your question from the 6/16/05?
 
When I receive an email with a word attachment, it would be nice if I could
run a macro that would...Open the word attachment, print the file, then close
word, and maybe the outlook window I used to open the file...that part I
don't have to have I guess.

I think I have it down except for the opening of the word doc from
Outlook...that's the tricky part!

Any ideas?

All your help is greatly appreciated.

Try this:

Sub PrintAtt()

Dim myAtt As Outlook.Attachment
Dim strTemp As String
Dim objShell As New Shell
Dim objFolderItem As FolderItem

strTemp = Environ("Temp")
For Each myAtt In ActiveInspector.CurrentItem.Attachments
myAtt.SaveAsFile (strTemp & "\" & myAtt.FileName)
Set objFolderItem = objShell.NameSpace(strTemp).Items.Item(myAtt.FileName)
objFolderItem.InvokeVerb ("Print")
'Kill objFolderItem.Path ' Can't delete yet because "Print" runs asynchronously
Next myAtt
ActiveInspector.Close (olDiscard)
End Sub

I'm not sure how to deal with the saved attachments; they probably need
to be deleted at some stage.
 
Mr. Bauer...I'm Sooo sorry! I just now saw your response! I was digging and
digging for info and did not check back with that particular one.

I want to say I'm sorry again, I know we don't help people out here for a
"No Response Back" that's for sure! So, Mr. Bauer, Let me take a lookzee
and see what I come up with.

My sincere apologies for not writing you back sooner...I couldn't find my
message, I think that is why I resent a new 1!

I'll write you again soon! I'm excited to try your code out and by the way,
you guys are AWESOME :)


Thx again.

Tim
 
Mr Bednarek,

I want to thank you as well...you guys are just to good!

I will let you know how it all works...I truly thank you again :)
 
Details? What in particular doesn't work?

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 

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

Back
Top