Moved Messages End Up In Wrong Folder

M

Mike Hartsough

I get a tiny amount of space on the Exchange Server. I constantly have to
clean out my Inbox, SentItems and Deleted Items folders to keep from getting
those "over limit" messages.

But I really like to hang onto these things longer than my server space
allows.

So I've written a little macro that moves messages out of my Deleted Items
folder and into a Personal folder. It works great, but with one little
glitch. Meeting Notices end up in my Drafts folder.

Here it is:

Option Explicit

Sub Move_Deleted()

On Error GoTo Handler

Dim objNS As NameSpace
Dim objPF As MAPIFolder
Dim objDl As MAPIFolder

Dim objItem As Object
Dim Total As Integer
Dim Index As Integer

Call MsgBox("Moving DeletedItems...", vbInformation, "Move_Deleted")

Set objNS = Application.GetNamespace("MAPI")

Set objPF = objNS.Folders.Item("Personal Folders"). _
Folders.Item("Saved"). _
Folders.Item("Deleted")

Set objDl = objNS.GetDefaultFolder(olFolderDeletedItems)

Total = objDl.Items.Count
For Index = Total To 1 Step -1

' Mark the item "read"
objDl.Items(Index).UnRead = False

' Move it
objDl.Items(Index).Move objPF

Next Index

Set objPF = Nothing
Set objDl = Nothing
Set objNS = Nothing

Exit Sub

Handler:

Call ReportError("Move_Deleted", Err)

End Sub ' Move_Deleted

Can anyone tell me what I've done to cause Meeting Notices to end up in my
Drafts folder?

Thanks,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top