How do I identify if it's a meeting request in this outlook macro?

Discussion in 'Microsoft Outlook VBA Programming' started by hirrsson, Jul 9, 2012.

  1. hirrsson

    hirrsson

    Joined:
    Jul 9, 2012
    Messages:
    2
    Likes Received:
    0
    Hi,

    I'm not a developer, was able to use internet to write my first outlook macro *proud*

    I have two questions?
    1)
    Is this macro ok, or did I forget something important?

    2)
    How can I get a "If, then else" statement here where the macro ONLY reacts on emails and not on meeting requests? I constantly get an error message, if I send (or reply on) any meeting requests. That's pretty annoying.
    It all started when I added the row "save email in the inbox". It seams like that outlook can't save meeting requests in any other folder then "sent folder".
    That is also what I want:
    This macro shouldn't react on meetings...

    Thanks
    Mike


    Code:
    Private Sub Application_ItemSend(ByVal Item As Object, _
        Cancel As Boolean)
      Dim objNS As NameSpace
      Dim objFolder As MAPIFolder
      Set objNS = Application.GetNamespace("MAPI")
      Set objFolder = objNS.PickFolder
      If TypeName(objFolder) <> "Nothing" Then
          Set Item.SaveSentMessageFolder = objFolder
        Else: Set Item.SaveSentMessageFolder = objNS.GetDefaultFolder(olFolderInbox)
      End If
      Set objFolder = Nothing
      Set objNS = Nothing
    End Sub
    
     
    hirrsson, Jul 9, 2012
    #1
    1. Advertisements

  2. hirrsson

    hirrsson

    Joined:
    Jul 9, 2012
    Messages:
    2
    Likes Received:
    0
    Thank you all for the help.. You really helped me!!!!!...
    Instead, Google (and 2 hours of testing), solved my problem,....

    Perhaps you could have a look and let me know if I do something wrong..

    Thanks


     
    hirrsson, Jul 10, 2012
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Cheryl Fischer

    Re: Create a meeting request using VBA

    Cheryl Fischer, Jul 10, 2003, in forum: Microsoft Outlook VBA Programming
    Replies:
    1
    Views:
    14,172
    Billy
    Jul 10, 2003
  2. Girish

    Sending Meeting Request using application/ms-tnef

    Girish, Apr 13, 2005, in forum: Microsoft Outlook VBA Programming
    Replies:
    1
    Views:
    587
    Sue Mosher [MVP-Outlook]
    May 12, 2005
  3. Guest

    Identify people who have accepted a meeting request

    Guest, Aug 26, 2005, in forum: Microsoft Outlook VBA Programming
    Replies:
    0
    Views:
    265
    Guest
    Aug 26, 2005
  4. Dale Fye

    Tracking meeting request responses in Outlook

    Dale Fye, Jan 7, 2010, in forum: Microsoft Outlook VBA Programming
    Replies:
    16
    Views:
    5,928
    Dale Fye
    Jan 8, 2010
  5. frilian
    Replies:
    0
    Views:
    651
    frilian
    Sep 2, 2010
Loading...

Share This Page