Consulting

Results 1 to 3 of 3

Thread: Item send - check for Meetings

  1. #1
    VBAX Regular
    Joined
    Jan 2014
    Posts
    7
    Location

    Item send - check for Meetings

    Hello,

    If you could kindly assist me with below matter:

    I have a simple macro that runs on "Item send" event.
    It works very well but it also triggers when users send invitations for meetings.

    Could you suggest how can I check before sending if the item is email or meeting?

    Please see my code below.

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    
    Dim question As String
    Dim strSubj As String
    
    
    strSubj = Item.subject
    Item.Display
    If InStr(Item.subject, "[Confidential]") > 0 Then
    Exit Sub
    Else                                                                                        '
    
    question = MsgBox("Please do something", , "Attention")
    
    MENU.SHOW
    Cancel = True
    
    End If
    
    End Sub
    Kind Regards,
    Lef

  2. #2
    It is a simple matter to establish what Item is before running the code e.g.

    Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    
    Dim question As String
    Dim strSubj As String
    
        If TypeName(Item) = "MailItem" Then
            strSubj = Item.Subject
            Item.Display
            If InStr(Item.Subject, "[Confidential]") > 0 Then
                Exit Sub
            Else                                                                                        '
                question = MsgBox("Please do something", , "Attention")
                MENU.Show
                Cancel = True
            End If
        End If
    End Sub
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

  3. #3
    VBAX Regular
    Joined
    Jan 2014
    Posts
    7
    Location
    Gmayor,

    Thank You.
    It works like a charm.

Posting Permissions

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