Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook General
Using OR in IF doesn't work...
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="info, post: 718202"] I found this function in this group, and trying to use in my macro, But I have problem with this line... What is wrong? CODE ************************************ Public Function Contains(spBody, ParamArray spText() As Variant) As Boolean Dim slText As Variant For Each slText In spText() If InStr(spBody, slText) Then Contains = True Exit For End If Next End Function ************************************ Private Sub colSentItems_ItemAdd(ByVal Item As Object) If Item.Class = olMail Then Dim intRes As Integer Dim strMsg As String If Contains(Item.To, "Lisa") Or Contains(Item.To, "Anna") Then strMsg = "Do you set a Orange flag with follow up in 7 days to this message in Sent Items?" intRes = MsgBox(strMsg, vbYesNoCancel + vbDefaultButton1, "Set flag") Select Case intRes Case vbNo 'Do nothing Case vbCancel Cancel = True Case vbYes Item.FlagIcon = olOrangeFlagIcon Item.FlagStatus = olFlagMarked Item.FlagDueBy = Now + 7 Item.FlagRequest = "Follow up" End Select End If Item.Save End If End Sub ************************************ [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Outlook Newsgroups
Outlook General
Using OR in IF doesn't work...
Top