![]() |
If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
![]()
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? |
#2
|
|||
|
|||
![]()
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? |
#3
|
|||
|
|||
![]()
Yes, there is another rule that moves the item to a folder. Are rules
run asynchronously - I had thought they were sequential. Should I incorporate all the preferred actions into the code as well? That is not as flexible as using rules but if it gets the job done I might have to live with it. By the way, thanks for your great work with Redemption! Regards, Wazza On Jun 2, 3:27 am, "Dmitry Streblechenko" wrote: 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 |
#4
|
|||
|
|||
![]()
Actually there are a number of rules that operate on the message - the
first rule contains my "run a script" option. Perhaps I should make it an event that runs when I hit the reply button - is that possible? On Jun 2, 6:28 pm, wrote: Yes, there is another rule that moves the item to a folder. Are rules run asynchronously - I had thought they were sequential. Should I incorporate all the preferred actions into the code as well? That is not as flexible as using rules but if it gets the job done I might have to live with it. By the way, thanks for your great work with Redemption! Regards, Wazza On Jun 2, 3:27 am, "Dmitry Streblechenko" wrote: 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 |
#5
|
|||
|
|||
![]()
You can try to create a rule that runs when a message is sent.
Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool wrote in message oups.com... Actually there are a number of rules that operate on the message - the first rule contains my "run a script" option. Perhaps I should make it an event that runs when I hit the reply button - is that possible? On Jun 2, 6:28 pm, wrote: Yes, there is another rule that moves the item to a folder. Are rules run asynchronously - I had thought they were sequential. Should I incorporate all the preferred actions into the code as well? That is not as flexible as using rules but if it gets the job done I might have to live with it. By the way, thanks for your great work with Redemption! Regards, Wazza On Jun 2, 3:27 am, "Dmitry Streblechenko" wrote: 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 |
#6
|
|||
|
|||
![]()
Except that I would already have decided which account and don't want
to change it. I experimented with some other things and the problem I am running into is that trying to change a field for a message during an event does not get reflected in the main window after the event has finished (e.g. on opening a new Inspector) unless you force Outlook to refresh its cache (I suppose) by closing the message, going into another folder and then returning and opening the message again. Then it reflects the changes I made. Is this an insurmountable problem? I tried using your MAPIUtils object and making a call to HrSetOneProp with bSave set to TRUE and it works but not until you force Outlook to refresh its view of the item. Most of the examples I see are about setting properties for items that have been created in the code and are then saved. When these are opened in the main Outlook window then they will reflect what has been done. I haven't seen any examples for modifying properties "on the fly" which is what I want to do. Unless I can think of a way to do the work whilst Outlook is occupied with other things, as it were (I used to call that 'batch processing'). Any ideas? On Jun 5, 5:06 am, "Dmitry Streblechenko" wrote: You can try to create a rule that runs when a message is sent. Dmitry Streblechenko (MVP)http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool wrote in message oups.com... Actually there are a number of rules that operate on the message - the first rule contains my "run a script" option. Perhaps I should make it an event that runs when I hit the reply button - is that possible? On Jun 2, 6:28 pm, wrote: Yes, there is another rule that moves the item to a folder. Are rules run asynchronously - I had thought they were sequential. Should I incorporate all the preferred actions into the code as well? That is not as flexible as using rules but if it gets the job done I might have to live with it. By the way, thanks for your great work with Redemption! Regards, Wazza On Jun 2, 3:27 am, "Dmitry Streblechenko" wrote: 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Redemption Inbox problem + instability | mirzoni | Outlook and VBA | 9 | December 8th 06 04:51 PM |
Outlook Redemption problem: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154. | [email protected] | Add-ins for Outlook | 1 | September 18th 06 09:44 AM |
Outlook Redemption problem: Retrieving the COM class factory for component with CLSID {...} failed due to the following error: 80040154. | [email protected] | Outlook - Using Forms | 1 | September 18th 06 09:44 AM |
Redemption - problem with Save | Martin | Outlook and VBA | 4 | January 31st 06 09:56 AM |
Problem with Sent Items/Redemption | קובץ | Outlook and VBA | 10 | January 12th 06 03:26 PM |