Consulting

Results 1 to 3 of 3

Thread: Outlook 365 display message on replyAll mailitem event

  1. #1
    VBAX Newbie
    Joined
    Oct 2023
    Posts
    2
    Location

    Outlook 365 display message on replyAll mailitem event

    I have tried putting the code in ThisOutlookSesssion mailitem send, reply and reply all and cant even hit a break point

    Any help greatly appreciated!
    Private Sub mailItem_Reply(ByVal Response As Object, Cancel As Boolean)
    Dim msg As String
    Dim result As Integer
    If myMailItem.Recipients.Count > 1 Then
        msg = "Do you really want to reply to one?"
        result = MsgBox(msg, vbYesNo, "Reply Check")
        If result = vbNo Then
            Cancel = True
       End If
    End If
    End Sub
    
    Private Sub mailItem_ReplyAll(ByVal Response As Object, Cancel As Boolean)
    Dim msg As String
    Dim result As Integer
    If myMailItem.Recipients.Count > 1 Then
        msg = "Do you really want to reply to one?"
        result = MsgBox(msg, vbYesNo, "Reply Check")
        If result = vbNo Then
            Cancel = True
        End If
    End If
    End Sub
    
    Private Sub mailItem_Send(Cancel As Boolean)
    Dim result As Integer
    If myMailItem.Recipients.Count > 1 Then
        msg = "Do you really want to reply to one?"
        result = MsgBox(msg, vbYesNo, "Reply Check")
        If result = vbNo Then
            Cancel = True
        End If
    End If
    End Sub
    Last edited by Aussiebear; 10-02-2023 at 12:58 PM. Reason: Added code tags to supplied code

  2. #2
    Moderator VBAX Wizard Aussiebear's Avatar
    Joined
    Dec 2005
    Location
    Queensland
    Posts
    5,059
    Location
    Welcome to VBAX zx10. When posting code to the forum please wrap your code with code tags. See the first line in my signature as a hint. Secondly, there is no need to double space between your lines, it simply uses up whitespace un necessarily. I noticed that the first sub has been doubled up, is that a typo?
    Remember To Do the Following....
    Use [Code].... [/Code] tags when posting code to the thread.
    Mark your thread as Solved if satisfied by using the Thread Tools options.
    If posting the same issue to another forum please show the link

  3. #3
    VBAX Newbie
    Joined
    Oct 2023
    Posts
    2
    Location
    Quote Originally Posted by Aussiebear View Post
    Welcome to VBAX zx10. When posting code to the forum please wrap your code with code tags. See the first line in my signature as a hint. Secondly, there is no need to double space between your lines, it simply uses up whitespace un necessarily. I noticed that the first sub has been doubled up, is that a typo?
    Ok, and the first sub is mailItem_Reply and the second is mailItem_ReplyAll

    Anyone here do any outlook 365 vba?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •