Solved

Move E-Mail to IMAP Trash Folder in Outlook 2003, when message is "Deleted"

Posted on 2006-07-06
7
11,057 Views
Last Modified: 2009-02-28
Question Title pretty much sums up the problem, but I will tell you the entire problem.

I have customers who use Outlook 2003 as their Mail Client, and they connect to our IMAP servers.  Every other functionality they love, but when they delete messages, they want them to go to their trash folder, rather then the regular "Strike Through, then Purge" method.  The only reason he wants this functionality is so that he can go back and look through his trash when he did not mean to delete something, or when something else happens.

I have already told him that a strike through is basically the same thing, and purging it is the actual deleation step.  I have already told him that he can just "Drag and Drop" items over into the trash, and that will work, but he is stubborn, and really wants things to work the exact same as they did with his account when he uses POP3 on our servers.

Question Summery:
Does anyone know of a way to highlight a message, hit delete, and the message get moved into the Trash folder rather then the Strike and Purge?
0
Comment
Question by:jetnet
  • 3
  • 2
7 Comments
 
LVL 97

Accepted Solution

by:
war1 earned 250 total points
Comment Utility
Greetings, jetnet !

There is nothing natively in Outlook that will allow you to delete IMAP email to Trash. You can use a VBA Macro to move deleted email to Trash
http://www.segebrecht.com/axel/computing/windows/deleting-imap-messages-in-microsoft-outlook

Best wishes!
0
 
LVL 2

Author Comment

by:jetnet
Comment Utility
I found this bit of code on there, and from the authors explanation, it looks like what I am looking for.  But how do I make this work now?
**********************
Sub DeleteMessages()

Set myOlApp = CreateObject("Outlook.Application")

Dim myNameSpace As NameSpace

Set myNameSpace = myOlApp.GetNamespace("MAPI")

Dim myExplorer As Explorer

Set myExplorer = myOlApp.ActiveExplorer

'Get the folder type, expected type is 0 i.e. mail folder. If other type of
folder
'being used then abort macro as it should only be used with mail folders.
folderType = myExplorer.CurrentFolder.DefaultItemType

'Check that folder is mail folder
If TypeName(myExplorer) = "Nothing" Or folderType <> 0 Then
GoTo invalidMailbox
End If

'Locate root folder for this account
Set thisFolder = myExplorer.CurrentFolder
Do Until thisFolder.Parent = myNameSpace
    Set thisFolder = thisFolder.Parent
Loop
Set accountFolder = thisFolder

'Identify selected messages
Dim selectedItems As Selection
Set selectedItems = myExplorer.Selection
Dim currentMailItem As MailItem
Dim iterator As Long

'Run loop on selected messages
For iterator = 1 To selectedItems.Count
Set currentMailItem = selectedItems.Item(iterator)

'Move messages to Deleted Items folder
Set trashFolder = accountFolder.Folders("Trash")
currentMailItem.Move (trashFolder)

Next

'Now, purge deleted messages
Dim myBar As CommandBar
Set myBar = Application.ActiveExplorer.CommandBars("Menu Bar")
Dim myButtonPopup As CommandBarPopup
Set myButtonPopup = myBar.Controls("Edit")
Dim myButton As CommandBarButton
Set myButton = myButtonPopup.Controls("Purge Deleted Messages")
myButton.Execute

Exit Sub

invalidMailbox:
MsgBox ("Macro configured only to work with mail folders! ")

Exit Sub

End Sub
**********************

Where am I suppose to put this, or do with it or.... anything?  Any help would be great, as I am no Outlook expert.
0
 
LVL 2

Author Comment

by:jetnet
Comment Utility
I still need a solution for what I need to do with this information?  Anyone want to helo me?
0
 
LVL 97

Expert Comment

by:war1
Comment Utility
jetnet, I am not familiar with the code or how to make it work for you situation. You may want to ask a new question. Best wishes!
0
 
LVL 97

Expert Comment

by:war1
Comment Utility
Thanks Venabili and DarthMod !
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Create high volume marketing opportunities using email signatures with these top 10 DOs and DON'Ts of email signature marketing.
Set OWA language and time zone in Exchange for individuals, all users or per database.
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now