Take a look at the MailItem.DeleteAfterSubmit property.

Signature
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
Hello,
Thanks for the help. I appreciate it.
Your suggestion worked except that now when I delete the original
message, it is moved to the deleted items folder, which isn't what I
want. If I don't delete the original message, it remains in my inbox
folder. I would like to delete the original message after it is
forwarded and to not have a copy of the message in my Deleted Items
folder.
Here is the code block I am using. (In my add-in VB project I display
a nonmodal form with a command button that the user clicks to forward
the email message not a userform in Outlook). And this works great
except the pesky problem. Possibly, I am doing something wrong.
Private Sub cmdPersonal_Click()
Dim myolapp As outlook.Application
Dim myNameSpace As outlook.NameSpace
Dim myFolder As outlook.MAPIFolder
Dim myItem As outlook.MailItem
Dim FWDItem As outlook.MailItem
Dim strInput As String
Dim myRecipient As outlook.Recipient
On Error GoTo cmdPersonal_Click_Err:
StartPrompt:
strInput = InputBox("Enter email address to where you want to
forward this email message?", "Forward", "", 4755, 6000)
If strInput = "" Then
If MsgBox("Please enter an email address to where you would
like to forward this email." & vbCrLf & vbCrLf & "Email address is
blank or Cancel was clicked." & vbCrLf & vbCrLf & "Would you like to
try again?", vbYesNo) = vbYes Then
GoTo StartPrompt
Else
Exit Sub
End If
Else
Set myolapp = CreateObject("Outlook.Application")
Set myNameSpace = myolapp.GetNamespace("MAPI")
Set myFolder = myNameSpace.GetDefaultFolder(olFolderInbox)
Set myItem = myolapp.ActiveInspector.CurrentItem an email is
already opened
Set FWDItem = myItem.Forward
Set myRecipient = FWDItem.Recipients.Add(strInput)
FWDItem.DeleteAfterSubmit = True New code as suggested by
Sue. Thanks!
myItem.DeleteAfterSubmit = True extraneous? Trial and error
to see if it works.
FWDItem.Send now send the message
'delete the original message
ClosedByProgram = True set flag
myItem.Delete
clear flag
ClosedByProgram = False
Unload Me
End If
cmdPersonnel_Click_Exit:
On Error Resume Next
If Err <> 0 Then Err.Clear
Exit Sub
cmdPersonal_Click_Err:
MsgBox Error$
Resume cmdPersonnel_Click_Exit
End Sub
So, as you can tell, I have 2 object variables: myItem pointing to the
original email message and FWDItem pointing to the forwarded email
message. After adding your suggestion
FWDItem.DeleteAfterSubmit = True that worked great by not saving a
copy in the Sent Items folder. However, I still end up with a copy of
the email in my Deleted Items folder (as a result of the line
myItem.delete).
Next, I commented out the line myItem.delete to see what would happen.
The message gets forwarded but the original message remained in my
inbox, which isn't what I wanted. So, that is the reason for the line
myItem.Delete. As soon as this line executes, a copy of the message is
put into my Deleted Items box (which is normal I guess). I would like
to unconditionally and permanently delete the original message in the
inbox. The manual way is to hold down the Shift key and push Delete,
but I am doing this through code.
Thanks again for all your help. Maybe there is another property that
I am missing. Any help is most appreciated. I also want to thank
everyone who has helped me.
Sue Mosher [MVP] - 16 Sep 2003 18:48 GMT
You would need to either delete from the Inbox, then delete it from Deleted Items or use CDO to perform the deletion, which will make it permanent in one step -- sample code at http://www.outlookcode.com/codedetail.aspx?id=41

Signature
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx
> Your suggestion worked except that now when I delete the original
> message, it is moved to the deleted items folder, which isn't what I
[quoted text clipped - 7 lines]
> inbox. The manual way is to hold down the Shift key and push Delete,
> but I am doing this through code.