lebarbo
XLDnaute Occasionnel
Bonjour à tous,
Après le passage en Outlook 2010, ma macro qui est dans le ThisOutlookSession servant à enregistrer une pièce jointe ne fonctionne plus. Elle ne se lance même plus. Y-a-t'il des paramétrages à modifier ?
Dim WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
Const xlNormal = -4143
If Item.Class = OLmail And InStr(1, Item.Subject, "rapport") > 0 Then
If Item.Attachments.Count > 0 Then
Dim objAttachments As Outlook.Attachments
Set objAttachments = Item.Attachments
For Each objAttach In objAttachments
objAttach.SaveAsFile "K:\essai.csv"
Next
Set objAttachments = Nothing
Call modif
End If
End If
End Sub
Merci d'avance pour votre aide,
Après le passage en Outlook 2010, ma macro qui est dans le ThisOutlookSession servant à enregistrer une pièce jointe ne fonctionne plus. Elle ne se lance même plus. Y-a-t'il des paramétrages à modifier ?
Dim WithEvents objInbox As Outlook.Items
Private Sub Application_Startup()
Set objInbox = Session.GetDefaultFolder(olFolderInbox).Items
End Sub
Private Sub objInbox_ItemAdd(ByVal Item As Object)
Const xlNormal = -4143
If Item.Class = OLmail And InStr(1, Item.Subject, "rapport") > 0 Then
If Item.Attachments.Count > 0 Then
Dim objAttachments As Outlook.Attachments
Set objAttachments = Item.Attachments
For Each objAttach In objAttachments
objAttach.SaveAsFile "K:\essai.csv"
Next
Set objAttachments = Nothing
Call modif
End If
End If
End Sub
Merci d'avance pour votre aide,