Bonjour,
J'ai créé une macro qui, sur pression d'un bouton, imprime toutes les pièces jointes de tous les courriels sélectionnés SAUF si la PJ fait moins de 12k.
J'aimerais la modifier ainsi mais je m'arrache les cheveux :
imprime toutes les pièces jointes (peu importe leur taille), SAUF si la pièce jointe est un .jpg ou .bmp qui fait moins que 12 k.
Merci beaucoup beaucoup de votre aide!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35 Set objSelection = Outlook.Application.ActiveExplorer.Selection For Each objItem In objSelection If TypeOf objItem Is MailItem Then Set objMail = objItem Set objAttachments = objMail.attachments objItem.PrintOut 'Save all the attachments in the temp folder For Each objAttachment In objAttachments If objAttachment.size > "12001" Then 'Si le fichier fait moins de 12k, il ne l'imprime pas - sert pour contrer les images de signatures strFilePath = strTempFolder & "\" & objAttachment.FileName objAttachment.SaveAsFile (strFilePath) 'Print all the files in the temp folder Set objShell = CreateObject("Shell.Application") Set objTempFolder = objShell.NameSpace(0) Set objTempFolderItem = objTempFolder.ParseName(strFilePath) objTempFolderItem.InvokeVerbEx ("print") Else End If Next objAttachment End If Next
Souriane
Partager