maherusa
asked on
Outlook 2007 Macro: Move Exchange messages On Exit
Hello,
Please help me modify the code below to accept messages within my Exchange 2003 environment itself (i.e. from an Exchange email account to my Exchange email account). The current scenario accepts external SMTP messages only.
Thank you
Please help me modify the code below to accept messages within my Exchange 2003 environment itself (i.e. from an Exchange email account to my Exchange email account). The current scenario accepts external SMTP messages only.
Thank you
Sub CRBQuit()
Const The_MailAccount_Name = "fred@fred.com"
Dim obj As Object
Dim mai As mailitem
Dim destFolder As Outlook.Folder
Set destFolder = Application.Session.GetDefaultFolder(olFolderInbox).folders("experts Exchange")
For Each obj In Application.Session.GetDefaultFolder(olFolderInbox).items
If obj.Class = olMail Then
Set mai = obj
If mai.SenderEmailAddress = The_MailAccount_Name Then
mai.Move destFolder
End If
End If
Next
End Sub
ASKER
Thanks Chris for the reply, but Ctrl+G didn't result in anything... I may also have not used the command correctly. Can you please give me more instructions on how to get the address using this shortcut?
Thanks.
Thanks.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Changing the mail address format to that of your server or adding an additional function to derive the SMTP address.
First option:
Try selecting an email from an internal address in the explorer, (don't open it though) then in teh VBE type in the immediate window, (ctrl + G to display it):
?application.activeexplore
Chris