P
Peter
The VBA code below is executed after sending a message in outlook (OL2003).
Unfortunatelty this code will give an error as result in case the message
send is an appointment. Does anyone know how i can prevent this error?
Thx.
Peter
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Exit Sub
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If TypeName(objFolder) = "Nothing" Then
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(olFolderDeletedItems)
End If
Item.SaveSentMessageFolder = objFolder (this line causes the error)
Set objFolder = Nothing
Set objNS = Nothing
End Sub
Unfortunatelty this code will give an error as result in case the message
send is an appointment. Does anyone know how i can prevent this error?
Thx.
Peter
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
Exit Sub
Dim objNS As NameSpace
Dim objFolder As MAPIFolder
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.PickFolder
If TypeName(objFolder) = "Nothing" Then
Set objNS = Application.GetNamespace("MAPI")
Set objFolder = objNS.GetDefaultFolder(olFolderDeletedItems)
End If
Item.SaveSentMessageFolder = objFolder (this line causes the error)
Set objFolder = Nothing
Set objNS = Nothing
End Sub