none
Outlook custom script sometime sudden stopped with err and it will untick the client client itselft.. please help RRS feed

  • Question

  • Exchange Server 2007 SP2

    Outlook 2010

    Here the script

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Sub CustomMailMessageRule(Item As Outlook.MailItem)

        Dim response
        Dim objOutlook As New Outlook.Application
        Dim ObjOutlookMsg As Outlook.MailItem
     
        Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
        With ObjOutlookMsg
            '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''.DeleteAfterSubmit = True
            .BodyFormat = olFormatHTML
            .To = xxx@gmail.com

            .Subject = Item.SenderName & ":" & Item.Subject
            .Body = .Body & "A new email has been received at your Company email account" & vbNewLine & vbNewLine
            .Body = .Body & " ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~" & vbNewLine & vbNewLine
            .Body = .Body & Item.Body
            .Send
        End With
        
        Set ObjOutlookMsg = Nothing
        Set objOutlook = Nothing
       
    End Sub

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    Client rule set if an email TO or CC contains my name and in my computer, it will run the script

    Thanks in advance

    Tuesday, March 6, 2012 8:56 AM