[mso] Re: Rules don't rule

  • From: "Green" <1z@xxxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Tue, 7 Oct 2003 16:41:19 +0200

Hello all,

I'm affraid I might be hitting my head against a brick wall with trying to
conquer Outlook rules but I'm rather stubborn so if this is getting boring
please don't shout at me too loudly.

Can anyone tell me why this doesn't work
Line A gets run then Line B and then Line D!! Line C doesn't get run at all!

Option Explicit

Public WithEvents oItem As MailItem
Public WithEvents oInspector As Inspector
Public WithEvents oInspectors As Inspectors
Public WithEvents oControl As CommandBarButton

Private Sub Application_NewMail()
' New Mail
Dim oFolder As Object
Dim oNewItem As MailItem

    On Error Resume Next
    Set oFolder = GetNamespace("MAPI").GetDefaultFolder(olFolderInbox)
    Stop
    'Exit Sub
    MsgBox oFolder.Items.Count
    For Each oNewItem In oFolder.Items.Restrict("[Unread] = 0")
        oItem = oNewItem
        StripHTMLBody     ' Line A
'        oItem.Save
    Next                  ' Line D
End Sub

Private Sub StripHTMLBody()
' Take the HTMLBody and comment it out and move it to the bottom
    Dim body As Object
    Dim html As Object

    body = oItem.body     ' Line B
    html = oItem.HTMLBody  ' Line C

    ' If there's an HTMLBody, convert it to plain-text
    oItem.HTMLBody = ""
    oItem.body = body
End Sub

TIA
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: