PC Review


Reply
Thread Tools Rate Thread

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

 
 
New Member
Join Date: Jul 2012
Posts: 2
 
      9th Jul 2012
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
 
Reply With Quote
 
 
 
 
New Member
Join Date: Jul 2012
Posts: 2
 
      10th Jul 2012
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


Quote:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)

If Item.Class = olMeetingCancellation Or _
Item.Class = olMeetingRequest Or _
Item.Class = olMeetingResponseNegative Or _
Item.Class = olMeetingResponsePositive Or _
Item.Class = olMeetingResponseTentative Then
' MsgBox "MEETING!!!! check-box can be deleted if it works"
Exit Sub
End If

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
End If
Set objFolder = Nothing
Set objNS = Nothing
End Sub
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Meeting Request reply deletes Outlook Meeting Raftermike Microsoft Outlook Calendar 2 9th Sep 2009 05:55 PM
Outlook Meeting Request from Win Mobile shows meeting time as current time Prilosec Microsoft Outlook 3 29th Feb 2008 01:48 PM
Outlook 2003 Meeting Request with Live Meeting Shows No Tracking D =?Utf-8?B?TWFncw==?= Microsoft Outlook Discussion 0 4th Apr 2007 02:58 PM
If you drag a meeting request or task request from your Inbox toCalendar or Tasks, the request is automatically accepted and an acceptancereply is sent to the senders. 34345445 Microsoft Access 0 3rd Mar 2006 02:09 AM
Identify people who have accepted a meeting request =?Utf-8?B?Tmlja0g=?= Microsoft Outlook VBA Programming 0 26th Aug 2005 08:57 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:11 PM.