[mso] Re: Rules don't rule

  • From: "Green" <1z@xxxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Tue, 7 Oct 2003 20:33:39 +0200

Hi Greg,

I'v just got a bee in my bonnet that's all. It started with me trying to
make a rule to pick out words in emails and move them to a folder.
Specifically "undelivered" and undeliverable. I'm so upset by these because
I'm getting so many! Anyway the rule worked for some mails and not others so
I got a bit curious and as I said in previous posting I'm a stubborn ...
person :-)

When I "examined" the passed over mails, by right clicking in them, I
discovered that all of them were HTML.

I looked on the web and found quite a bit of code that changed html to text
and so what I'm doing now is to try and make some of it work. Then I can see
if the rules are skipping things because the messages are html or some other
reason.

So far it looks as though the rules don't act on, wether they look or not I
don't know, conditions for the body if the messages in html. I suppose this
makes sense really because the "body" is text and I don't see a condition
for "... the html body".

I've actually worked through the code now and what was stumping me then was
that On Error thingy. There was an error in line B because the object wasn't
"Set" and of course it jumped to line D which was the Resume next line! I
normally try not to use On Error Resume Next because I feel that if there is
an error you should be able to deal with it... but as I said, I'm trying to
get someone elses code to work. I really don't know how they got it to work
in the first place.

So what I'm trying to do is alter the messages as they come in so that the
rules wizard can handle them.... But.... the whole problem with this is that
at the moment I'm also altering all the other incoming emails as well!! What
I don't want to end up writing is a spam handler though. I think you
mentioned a good one in a previous post but I've deleted it unfortunately.

My twisted mind is now trying to figure a way of altering just the emails I
want *back* to HTML so I can see them okay... Maybe from a list or
something... dunno. I have working vba code to read/write to the register
and maybe that's an option for a list... hmmmm..

Key to this though is being able to run a macro from a rule. I've tried to
do this but I'm stuck when I get to the wizard part for "custom action".
Have you any clue as to how I set up the wizard to say run this macro?  I'd
like to be able to "... run now" a macro really. Also, do you know if it's
possible for a message to have a body *and* a html body?

BTW I really like the code in your reply. If you have no objections I'm
going to use some of it with appropriate credit of course. I think using
olFormatHTML and olFormatPlain is great. At the moment I'm using...
.........
slHTML = oItem.HTMLBody
If Trim(slHTML) <> "" Then
.........

Which I feel a bit icky about.... Same as using option explicit I suppose
:-)

If you want to look at what I have so far and have the time I'd appreciate a
crit from someone I consider an expert in these things.

Many thanks for your time

Regards
Lisa


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx with the word "unsubscribe" (without the quotes) in 
the subject line.

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: