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
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