Solved

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

Posted on 2006-07-06
7
11,091 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
ID: 17055231
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
ID: 17059844
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
ID: 17442805
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
ID: 17442946
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
ID: 17619792
Thanks Venabili and DarthMod !
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

What does UTC stand for?  “Coordinated Universal Time” – Think of this as the true time on Planet Earth that never changes with the exception of minor leap seconds here and there to account for the changes in the planet's rotation.   What does th…
To add imagery to an HTML email signature, you have two options available to you. You can either add a logo/image by embedding it directly into the signature or hosting it externally and linking to it. The vast majority of email clients display l…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

831 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