PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Macro to automate opening attachments? (sender is trusted source)
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Macro to automate opening attachments? (sender is trusted source)
![]() |
Macro to automate opening attachments? (sender is trusted source) |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
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! |
|
|
|
#2 |
|
Guest
Posts: n/a
|
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 |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

