Forward messages conditionally to users

  • Thread starter Thread starter Arslanian
  • Start date Start date
A

Arslanian

I have 50 or so emails each day from two different places that I need t
foward to a group of four people on exchange (cycling through the lis
so each one gets roughly the same number as the last). ie- I get 9
emails today. I forward 23 to each one of the four. I can't write
rule (at least I don't think so) for that since I need to foward thes
variably.

I don't really know the syntax to do what I am thinking.

Find either sender1 or sender2 name from inbox.
Take one and forward message to #1,#2,#3 or #4 users (i
exchange)depending on who got the last one
Move message to folder named(sender)
get next

Make sense
 
I don't have exchange--so I'm only taking a guess--but it's something to
consider.

Have a message rule setup that moves all messages from these two places to a
seperate folder. Then you could have a macro that uses the "FolderChanged"
property. When that folder has changed--i.e. when new messages are placed
in that foler, then distributed them to the recipients:

'Note--I use VB.Net and it's been
'YEARS since I've done anything
'in previous versions of VB (and
'NEVER VBA--just getting started
'with that). This MAY require code
'adjustments therefore--but you
'get the idea.
dim index as integer = 1
dim recipient(4) as string = ("(e-mail address removed)", "(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)")
for each msg in msgFolder
forwardMsg(msgID, recipent(index))
index = index +1
If index = 4 then
index = 0
end if
next
 
Thanks for the reply.

I pieced together things from your post as well as others. I don't kno
what I am doing with the 'set' parts.
I put some questions in the comments below.
Thanks for your time.


Sub forward()
Dim recipient(2) As String
Dim index As Integer
Dim objNameSpace As Outlook.NameSpace
Dim objInboxFolder As Outlook.MAPIFolder

'*****************************************
'I pieced this from others. Since I don't know what is going on o
'what is supposed to go on, here's my take on it.
'The objInboxFolder just gets the list of folders for the session?
'The inboxItmes gets the contents of the folders?

Set objNameSpace = Application.Session
Set objInboxFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objInboxItems = objInboxFolder.Items

'*****************************************
'This part is completely made up. I want to point to a folder and fin

'unread messages, I guess.
'name of the folder "Monster"

Set monster = objInboxFolder.Folders("Monster")
'this would get the contents?
Set numMonster = objInboxFolder.Items

recipient(1) = "recipient1"
recipient(2) = "recipient2"
index = 1
For Each numMonster In monster 'this needs to be changed for unread
If index = 4 Then
End If

'Not sure how to write a sub to foward. Where's the msgID?
Call forwardMsg(msgID, recipient(index))
index = index + 1
If index = 4 Then
index = 0
End If
Next

End Sub


I don't have exchange--so I'm only taking a guess--but it'
something to
consider.

Have a message rule setup that moves all messages from these tw
places to a
seperate folder. Then you could have a macro that uses th
"FolderChanged"
property. When that folder has changed--i.e. when new messages ar
placed
in that foler, then distributed them to the recipients:

'Note--I use VB.Net and it's been
'YEARS since I've done anything
'in previous versions of VB (and
'NEVER VBA--just getting started
'with that). This MAY require code
'adjustments therefore--but you
'get the idea.
dim index as integer = 1
dim recipient(4) as string = ("(e-mail address removed)"
"(e-mail address removed)",
"(e-mail address removed)", "(e-mail address removed)")
for each msg in msgFolder
forwardMsg(msgID, recipent(index))
index = index +1
If index = 4 then
index = 0
end if
next


Arslanian said:
I don't really know the syntax to do what I am thinking.

Find either sender1 or sender2 name from inbox.
Take one and forward message to #1,#2,#3 or #4 users (in
exchange)depending on who got the last one
Move message to folder named(sender)
get next
 
Back
Top