Bug(?): VBA and Categories

  • Thread starter Thread starter Christian Dembowski
  • Start date Start date
C

Christian Dembowski

Hi everyone,

using Outlook 2003 I just observed something I do not understand:

First I set up a macro which looks something like this:

Sub SetServerStay(ByRef olMail As Outlook.MailItem)
olMail.Subject "a changed subject"
End Sub

then I let this macro run by a rule. Works perfectly.

Now, the funny thing is: If I change the category of the mail by a
rule the Subject gets changed back to the original one. This does not
depend on the order of the rules! I do not understand why this
happens. If I assign the category before I change the Subject using
vba I should be fine, shouldn't I?

Can anybody reproduce this behavior?

TIA,
Dembo
 
Try adding olMail.Save to your macro. As it currently stands, you're not saving the change permanently.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
Hi Sue,

Try adding olMail.Save to your macro. As it currently stands, you're not saving the change permanently.

sorry, forgot to mention olMail.Save is there of course.

Just to give you some additional details:

I have three rules defined:

a) A VBA macro that changes the subject
b) A rule that assignes a category
c) A VBA script that assignes a category

And here are my results:

only (a) : Subject gets changed - fine
(c) and (a) OR (a) and (c): Subject gets changed - fine
(b) and (a) OR (a) and (b): Subject is not changed - not fine :(

If I set a breakpoint and step through the macro I can see that the
subject is indeed changed however, when the macro has been processed
it jumps back to the old subject - even if the order of the rules is
first (b) then (a)

Very strange indeed and I am almost certain that it is a bug and not a
feature.

I would be very gratefull for confirmations of this behavior.

Bye,
Chris
 
Why not just modify rule (b) so that it's more like rule (c)?
--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top