PC Review


Reply
Thread Tools Rate Thread

Macro to automate opening attachments? (sender is trusted source)

 
 
=?Utf-8?B?U3VlVA==?=
Guest
Posts: n/a
 
      11th Nov 2005
I regularly receive an email containing other emails as attachments (maybe
100). These attached emails themselves contain attachments (hpgl or pdf files
- one per email) which I need to extract to a folder on our network (so that
I can run a batch process on them). I divert the incoming mails to a
dedicated subfolder in Outlook (2003) - I need a macro which I can run on
this subfolder. (The sender is a trusted source - so I know that these
particular emails are safe, not malicious.)

I'm "just a secretary" and new to VBA (but learning rapidly) so please be
gentle with me!

 
Reply With Quote
 
 
 
 
nida
Guest
Posts: n/a
 
      13th Nov 2005
Hello Sue

As you said you are learning rapidly so i will only include bare code.

code:
set oFolder1 = onms.GetDefaultFolder(olInbox)
set oFolder2 = oFolder1.Folders("Name of Folder here")

for each i in oFolder2.items
for each i1 in i.attachments.items
...saveas here
next
next

note: if your attachment is by itself a mailitem, it is a bit trickier
- you need to save the attachment as ".msg" file and open it again by
creatiing a new mailitem object from template (CreateFromTemplate) then
look into this mailitem for your attachments.

this is just an attempt to show you how it is done, however if you
require the full working code i will post it on the site or to your
email address.

Hope that helps,

Nida Sharar

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
macro automatically save attachments to several emails from the same sender ThomasX Microsoft Outlook VBA Programming 0 6th Jun 2011 03:59 PM
Macro to store outlook email attachments to hd folders with sender names andie6931 Windows XP 0 18th Dec 2009 06:06 AM
How do I get the attachments to show from a trusted source? Sandy Microsoft Outlook Discussion 1 23rd Feb 2009 07:58 PM
Automate Macro when Opening Access2003 =?Utf-8?B?QW5uYSAtIFBsZWFzZSBIZWxwIE1lIGZpbmQgYW4g Microsoft Access Security 2 4th Jan 2006 10:43 PM
Outlook should let me to see .mdb attachments from trusted source =?Utf-8?B?QnJ1Y2UgVw==?= Microsoft Access 3 28th Jul 2005 11:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:57 PM.