View Single Post
  #1  
Old June 1st 07, 08:12 AM posted to microsoft.public.outlook.program_vba
[email protected]
external usenet poster
 
Posts: 6
Default Problem using Outlook Redemption VBA code

I use Google for Applications to manage my email and have two domains
that receive email. When I retrieve new mail into Outlook it all
comes under the one email account. What I wanted to do was change the
account for mail from to my personal email so that when I reply to it,
it defaults to the right account (different sending email address,
signature etc).

Outlook Redemption looked great as I can access the Account whereas
the normal Outlook Object Model doesn't permit access to that in
Outlook 2003. I have a Inbox Rule that runs before all other rules
and looks for mail with "bainsworld" in the message header - this
causes the following to run:

Sub SetBainsworldAccount(inpItem As MailItem)

Dim Session As Redemption.rdoSession
Dim Account As Redemption.RDOAccount
Dim Item As Redemption.RDOMail

Set Session = New Redemption.rdoSession
Session.MAPIOBJECT = Application.Session.MAPIOBJECT
Set Account = Session.Accounts("bainsworld")
Set Item = Session.GetMessageFromID(inpItem.EntryID)
Item.Account = Account
Item.Save

End Sub

However whilst this rule works perfectly when I manually run it, it
doesn't work when run automatically. There is no error generated in
the rule, it just doesn't seem to work. Any ideas?

Ads