View Single Post
 
Old 02-18-2017, 10:27 PM
gmayor's Avatar
gmayor gmayor is offline Windows 10 Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,137
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

So you want me to do the tedious task ?

In the example you quoted an event is used to create a 'forward' e-mail, for any message posted into one of two sub folders of the default Inbox. If you are using a subfolder of a sub folder 'News' of Inbox then the syntax is slightly different e.g. for a sub-subfolder 'Newsletters':

Code:
Set NewsLetters = GetNS(olApp).GetDefaultFolder(olFolderInbox).folders("News").folders("NewsLetters").Items
Using that example you would need to create an event for each of the sub-subfolders in question. It's just a matter of changing the names and adding others.

The individual event processes in the example simply create and display the message. You could of course do what you wish with the message 'olItem' including sending it to a particular individual e.g.

Code:
Private Sub Newsletters_ItemAdd(ByVal item As Object)
    On Error GoTo err_Handler
    Set olItem = item.Forward
    With olItem
        .To = "someone@somewhere.com"
        .Send
    End With
lbl_Exit:
    Exit Sub
err_Handler:
    MsgBox Err.Number & " - " & Err.Description
    GoTo lbl_Exit
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote