outlook retrieving attachments from email and putting in a directory

Q

Q X

Hello All,

1) Is it possible to set up outlook such that it is possible to grab
attachments from certain emails that come to your inbox and put it
into a particular directory? If so how?

2) Is it possible to have outlook constantly check a particular
directory for a file and automatically send an email with the file as
an attachment to someone based on the directory name? If so how?

The reason for this is that I get a lot of emails with attachments.
With these attachments I need to run a program using these attachments
and then send an email back to them with another attachment. I am
thinking of trying to automate the process.

Some guidance is very much appreciated!
 
B

Brian Tillman

Q X said:
Hello All,

1) Is it possible to set up outlook such that it is possible to grab
attachments from certain emails that come to your inbox and put it
into a particular directory? If so how?

Sounds like you want to use Eudora. That how Eudora works. Outlook doesn't
work that way.
2) Is it possible to have outlook constantly check a particular
directory for a file and automatically send an email with the file as
an attachment to someone based on the directory name? If so how?

Not that I'm aware. However, you should be able to wriet a program that
will do that and call Outlook when needed.
 
Q

Q X

Brian Tillman said:
Sounds like you want to use Eudora. That how Eudora works. Outlook doesn't
work that way.

That's unfortunate. I heard maybe you can use rules somehow, but
haven't found out how yet. :(
Not that I'm aware. However, you should be able to wriet a program that
will do that and call Outlook when needed.

Oh really? Is this possible using dos? How can I programmically (or
using a scripting language like tcl, perl, python) send email using a
PC?

Thanks for your reply!
 
B

Brian Tillman

Q X said:
Oh really? Is this possible using dos? How can I programmically (or
using a scripting language like tcl, perl, python) send email using a
PC?

Visual Basic or C# would be appropriate languages to use. tcl, Python,
perl, etc. are not. As to how to write them, perhaps
microsoft.public.outlook.program_vba would be a better newsgroup.
 
J

Jan Persson

Brian Tillman said:
Visual Basic or C# would be appropriate languages to use. tcl, Python,
perl, etc. are not. As to how to write them, perhaps
microsoft.public.outlook.program_vba would be a better newsgroup.

I don't know much about Perl and Tcl, but Python actually handles Windows
specific API's very well and this makes it an excellent choice for
many applications. You can write services, automation servers and other
Windows stuff in Python which from the users perspective will taste and
smell exactly like it was written in C++.

As a small example you can use the COM integration to print the available
folders with the following code:

import win32com.client
object = win32com.client.Dispatch("Outlook.Application")
ns = object.GetNamespace("MAPI")
for f in ns.Folders: print f

As a more elaborate proof of concept you can take a look at SpamBayes which
is a spam filter integrated in Outlook which is written in Python.

http://starship.python.net/crew/mhammond/spambayes/

For more information about Python take a look at http://www.python.org/.

Kind regards
//Jan Persson
 
J

Jan Persson

That's unfortunate. I heard maybe you can use rules somehow, but
haven't found out how yet. :(


Oh really? Is this possible using dos? How can I programmically (or
using a scripting language like tcl, perl, python) send email using a
PC?

Thanks for your reply!

Hi,

I could not hold myself back so here we go in Python. Please change the
name of the folders into the right setup for you.

Kind regards
//Jan Persson

--- cut here -----------------------------------------------------------

from win32com.client import *

app = Dispatch("Outlook.Application")
ns = app.GetNameSpace("MAPI")
f1 = ns.folders('Mailbox - John Doe')
f2 = f1.folders("Inbox")
for l in f2.Items:
for a in l.Attachments:
print a
try:
a.SaveAsFile("c:\\temp\\"+a.DisplayName)
except pywintypes.com_error:
pass
 

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