Outlook - Multitasking Macro?

Ceejay64

Bass Playin' Biker Chick
Local time
Today, 03:08
Joined
Oct 2, 2002
Messages
74
Hey there, folks,
Got one I need some help on. Perhaps one of you has tried something like this before...
I need to create a tool that will allow me to do the following:

1. Search an Outlook email box for all emails that have a keyword in the subject line that I have chosen from a drop list
2. Open all qualifying emails
3. Print all of them, including all attachments associated with them
4. Close the emails, and move them all to a folder

I've got the email box linked to Access (we've got 2003 running here), and I have no problem accessing the emails and even deleting them, etc. I can see if they have an attachment, but am unable to discern where it is or how to get to it to open it. I also cannot get the emails to show as "read" when I open them using the db. There is a col for "contents unread," but it is a number variable (I cannot change this since it's a linked table), and all rows are blank anyway.
It is important that I am able to print them including the attachments and move them out when done.

Whaddya think?? I'm open to any and all suggestions!
Thanks in advance,
Ceejay
 
Last edited:
First, from a system administration/security administration viewpoint, NEVER automatically open e-mails. You will launch every Trojan Horse, Virus, Worm, and TimeBomb in creation. Even with an updated copy of something such as Norton AntiVirus or McAfee or any of the other excellent products, I don't trust them to be complete or accurate. If I were your network admin, I'd take your machine away from you and give you an abacus. Or let you experience first-hand the myriad joys of having to wipe and reload a Windows machine every day. I've seen it done by a ten-year professional. Took him 3 days to undo the damage caused by inadvertantly opening one e-mail that had maybe 3 SECONDS of activity.

If my comment sounds harsh, just remember that even U.S. Government sites get bombarded by malicious mail EVERY DAY. I work with the U.S. Navy Reserve. I teach Windows security to other system admins. I know whereof I speak.

Second, despite my advice, you probably want to proceed. So if you are going to pursue this, you need to identify and learn about an Office Automation method (in the formal sense of the word "method"; and it would be an Outlook method, so you probably look in the Outlook help files on topics about using VBA within Outlook). The method you want is one that allows you to save the attachments to your local drive before you try to open tem, then do your "print" thing, then delete the files when you are done with it using the VBA "Kill" statement, then delete the mail message in that order.

If this is a mental exercise, you would do better to not do this. If it is a requirement given you by your boss, I strongly advise you to print this reply and show it to your boss, who obviously doesn't grasp the gravity of automating such things in today's world of hackers, terrorists, and unwise script-kiddies.

And please try to not take this reply as a personal attack, though I know it came out strong. It is just that it is a complex and treacherous subject that even I, with 30+ years of specialized experience, won't approach calmly.
 
Thanks for the reply, Doc!
Yes, it was a request from one of our customers who was lamenting the amount of time that was needed to sift through all of the emails in the public mailbox.
I will mention the security factors to them. I'm sure that this wasn't considered. Security here, as a rule, is pretty tight, but as we know, that often doesn't mean a thing.
Thanks for the advice and the direction in case they opt to go with it anyway. :)
~C
 

Users who are viewing this thread

Back
Top Bottom