0
votes

I would like to create an archive of OUTGOING attachments in a folder (a Windows folder, outside Outlook). I have used scripts to save attachments from INCOMING messages by using some of the solutions provided on this site, but I don't see a way to set this up for outgoing mail. I also tried to set up a rule to apply a script to all outgoing messages, but I don't see an option to "run a script" on messages I send (like I can for incoming messages).

I can probably use a script that parses an outlook folder, but it would be much more effective to have it run in real-time as messages are sent.

2
If you could be more precise, that'd be great. You could have a look at this for starters if: stackoverflow.com/questions/17569372/… - Preston
Add your script to the question, and which office are you using. - 0m3r

2 Answers

1
votes

Process the Application.ItemSend event - the item will be passed as a parameter to your event handler. You can then process the message attachment the same way your process the incoming messages.

0
votes

If you really want to use the Outbox instead of the ItemSend event (which is probably a better solution), try this (found here and modified to use Outbox)

Public WithEvents myOlItems As Outlook.Items 

Public Sub Initialize_handler() 

    Set myOlItems = Application.GetNamespace("MAPI").GetDefaultFolder(olFolderOutbox).Items 

End Sub 


Private Sub myOlItems_ItemAdd(ByVal Item As Object) 

     'your code to save attachments here

End Sub