View Single Post
  #2  
Old June 1st 07, 06:27 PM posted to microsoft.public.outlook.program_vba
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Problem using Outlook Redemption VBA code

Does any other rule touch the same item?
The problem might be a conflict between inpItem and Item (they both refer to
the same message).

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ups.com...
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