Moving Contacts to Deleted Items folder puts record in Drafts folder! HELP!

  • Thread starter Wendi Taranto via OfficeKB.com
  • Start date
W

Wendi Taranto via OfficeKB.com

I want to move particular Contacts to the Deleted Items folder. But, each
time I do, a copy of this Contact (in Message format) is put into the
Drafts folder as well. I do not want this in the Drafts folder. Below is
my code (Sub MoveToDeletedItems is sent as parameter a hard return
delimited string of EntryID's):

Private Sub MoveToDeletedItems(sIDs As String)

On Error GoTo ErrorHandler

Dim vID As Variant
Dim sID As String
Dim i As Long
Dim objDeletedItemsFolder As Outlook.MAPIFolder
Dim objContactItem As Outlook.ContactItem

Set objDeletedItemsFolder = objMAPI.GetDefaultFolder(3)

vID = Split(sIDs, vbCrLf)

For i = 0 To UBound(vID)
sID = vID(i)
If sID = "" Then GoTo GetNext
Set objContactItem = objMAPI.GetItemFromID(sID)
objContactItem.Move (objDeletedItemsFolder)
objContactItem.Save
GetNext:
Next

Exit Sub

ErrorHandler:

If Err.Number = -1041104887 Then
Resume Next
ElseIf Err.Description = "Can't move the items." Then
Resume Next
Else
MsgBox "OLLINK Duplicate Checker [MoveToDeletedItems] encountered
error # " & Err.Number & ", " & Err.Description & _
vbCrLf & vbCrLf & "'" & objContactItem.FirstName & " " &
objContactItem.LastName & "'"
'End
End If

End Sub
 

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