darxmurf meow | Voilà quelques infos trouvées ici et là.
Dans tous les cas notre ami outlook (2003) freez quand il déplace des emails du local à l'IMAP. Que ce soit fait par macro ou par drag'n drop.
Plusieurs solutions s'offrent à vous donc.
1) la règle qui déplace le message après l'envoi. ça dérange pas pour les petits mails mais avec un gros truc ça freez... si vous avec une connex 100mo c'est mois un soucis évidemment
2) faire une macro qu'on lance tous les soirs avant de partir qui vide le dossier "Sent items" local et copie le tout sur l'IMAP. Ca marche mais si d'un coup vous voulez vérifier un truc dans votre outlook vous devez attendre la fin de la copie... et ça peut être long
Dans les autres trucs trouvés, l'histoire des fichiers supprimés.
En IMAP quand on supprime un fichier, il se trace et reste là jusqu'à ce qu'on Purge le tout. Certaines personnes VEULENT que les mails se déplacent dans un répertoire genre "Deleted items" du serveur...
2 solutions
1) faire un drag'n drop des emails en question vers la poubelle IMAP
2) faire une macro qui déplace le truc et le supprime après. L'avantage c'est qu'on peut ajouter un bouton dans la barre d'outils et comme ça les gens sont contents.
Pour la macro c'est par là
Code :
- Sub Delete()
- ' By Douglas J. Nakakihara (http://offbe.at)
- '
- ' A lot has been written about how Google was able to adapt their email engine to support IMAP.
- ' It's use of labels instead of a folder hierachy results in emails never being really deleted
- ' even when they are no longer visible in the Inbox folder/label. Essentially, the "Inbox" label is
- ' removed, so the email no longer appears in the Inbox. It remains, however, on the mail server.
- '
- ' The quick solution is to just drag emails to the Trash "folder" (really just a special label).
- ' This macro automates the process and will automatically move selected emails to the Google
- ' [Gmail]/Trash folder, just like deleting normally. Gmail deletes Trash email after 30 days.
- '
- ' The only modification you should need to do is change the OLaccountName varible below
- ' You'll also need to change the Security Level to Medium (Tools menu > Macro > Security)
- '
- ' To install:
- ' 1. Tools menu > Macro > Visual Basic Editor
- ' 2. On the left side, right-click Module and chose Module > Insert > Module
- ' 3. Copy and paste this code in the window
- ' 4. Save and close the VB editor
- '
- ' You can add the macro to your toolbar or just run it from Tools menu > Macros.
- '
- ' To add to the toolbar:
- ' 1. Right-click the toolbar and choose Customize
- ' 2. On the Commands tab select Macros
- ' 3. Drag the gmailDelete command to the desired position on the toolbar
- ' 4. Right-click the macro on the toolbar and choose Default Style. You can also choose
- ' Change Button Image to customize the icon.
- '
- ' Code inspiration:
- ' Outlook moving code by Chewy Chong at:
- ' http://verychewy.com/archive/2006/ [...] older.aspx
- ' getfolder function:
- ' http://wiki.activityowner.com/inde [...] linker.bas
- '
- ' NOTE: If you drag/move email from an IMAP folder to a folder on your PC, it just becomes
- ' unlabeled. One workaround, albeit a PITA, is to copy the email to the folder and then
- ' use this macro.
- '
- ' Searching for unlabeled email from Gmail Tip #22
- ' at http://www.g04.com/misc/GmailTipsComplete.html:
- '
- ' ...if you want to list all unlabeled messages, just create a long search string containing
- ' every label that you have defined. Be sure to include the "-" character in front of every
- ' label. This ensures that messages with these labels will be EXCLUDED (remember, you are
- ' looking for all messages WITHOUT Labels.) You can also optionally include the hidden
- ' "inbox" Label to exclude anything in your Inbox.
- '
- ' For example, if you have defined the Labels "Family", "Friends", "Ebay", and "Support",
- ' you would enter the following string into the search field (note that the labels are not
- ' case sensitive) to find all Unlabeled messaegs:
- '
- ' -label:inbox -label:family -label:friends -label:ebay -label:support
- '------------------------------------------------------------------------------------------
- Dim OLaccountName As String
-
- OLaccountName = "Mailbox" 'Account name in Outlook
- MoveSelectedMessagesToFolder (OLaccountName)
-
- End Sub
- Sub MoveSelectedMessagesToFolder(oStore As String)
- On Error Resume Next
- Dim folderName As String
- Dim objFolder As Outlook.MAPIFolder
- Dim objInbox As Outlook.MAPIFolder
- Dim objNS As Outlook.NameSpace
- Dim objItem As Outlook.MailItem
-
- folderName = "Trash" 'Do not change
-
- 'The NameSpace is the object that gives you access to all Outlook's folders.
- 'In Outlook there is only one and it is called "MAPI" which is an acronym
- 'for Messaging Application Programming Interface.
-
- Set objNS = Application.GetNamespace("MAPI" )
- Set objInbox = objNS.GetDefaultFolder(olFolderInbox)
- Set objFolder = getfolder(oStore, folderName)
- If objFolder Is Nothing Then
- MsgBox folderName & " doesn't exist!", vbOKOnly + vbExclamation, "INVALID FOLDER"
- End If
- If Application.ActiveExplorer.Selection.Count = 0 Then
- 'Require that this procedure be called only when a message is selected
- Exit Sub
- End If
- For Each objItem In Application.ActiveExplorer.Selection
- If objFolder.DefaultItemType = olMailItem Then
- If objItem.Class = olMail Then
- objItem.Move objFolder
- End If
- End If
- Next
- Set objItem = Nothing
- Set objFolder = Nothing
- Set objInbox = Nothing
- Set objNS = Nothing
- End Sub
- Function getfolder(oStore As String, ofolder As String) As Outlook.MAPIFolder
- Dim objNS As Outlook.NameSpace
- Dim found As Boolean
- Dim outlookstore As Outlook.MAPIFolder
- Dim newname As String
- Set objNS = Application.GetNamespace("MAPI" )
- found = False
- 'Get OutLook Store
- While Not found
- On Error Resume Next
- Set outlookstore = objNS.Folders(oStore)
- If outlookstore Is Nothing Then
- MsgBox "Outlook store " & oStore & " not found. ", vbOKOnly + vbExclamation, "Outlook store not found"
- Exit Function
- Else
- found = True
- End If
- Wend
- 'Get Outlook Folder
- found = False
- While Not found
- On Error Resume Next
- Set getfolder = getgmailfolder(outlookstore, ofolder)
- If getfolder Is Nothing Then
- MsgBox "Outlook Folder " & ofolder & " not found. ", vbOKOnly + vbExclamation, "Outlook Folder not found"
- Exit Function
- Else
- found = True
- End If
- Wend
- 'clean up
- Set objNS = Nothing
- End Function
- Public Function getgmailfolder(ByRef oStore As Outlook.MAPIFolder, strFolderPath As String) As MAPIFolder
- ' folder path needs to be something like
- ' "Public Folders\All Public Folders\Company\Sales"
-
- Dim colFolders As Outlook.Folders
- Dim objFolder As Outlook.MAPIFolder
- Dim arrFolders() As String
- Dim i As Long
- On Error Resume Next
- strFolderPath = Replace(strFolderPath, "/", "\" )
- arrFolders() = Split(strFolderPath, "\" )
- Set objFolder = oStore.Folders.Item(arrFolders(0))
- If Not objFolder Is Nothing Then
- For i = 1 To UBound(arrFolders)
- Set colFolders = objFolder.Folders
- Set objFolder = Nothing
- Set objFolder = colFolders.Item(arrFolders(i))
- If objFolder Is Nothing Then
- Exit For
- End If
- Next
- End If
- Set getgmailfolder = objFolder
- Set colFolders = Nothing
- End Function
|
remplacez la ligne : OLaccountName = "Mailbox" avec votre nom de compte IMAP
et la ligne : folderName = "Trash" 'Do not change
avec le nom de votre répertoire poubelle ![:o :o](https://forum-images.hardware.fr/icones/redface.gif) ---------------
Des trucs - flickr - Instagram
|