originals emails are getting deleted if i issue a resend via vba

Access 2010 vba
sending emails via Microsoft Outlook 2010 through vba in access

I'm searching through the "Inbox" folder on a certain profile(store)
If it finds what i'm looking for it "resends" that email to its original "sendto"

PROBLEM:
The original email it finds...is getting deleted ?
after its does   a   "olResendMsg"





 
' LOOK FOR OUTLOOK OPEN
Dim objOL As OUTLOOK.Application
' search inbox for this id
Dim myOlApp As New OUTLOOK.Application
Dim myNameSpace As OUTLOOK.Namespace
Dim myInbox As OUTLOOK.MAPIFolder
Dim myitems As OUTLOOK.Items
Dim myitem As Object
Dim Found As Boolean
Dim objInsp As OUTLOOK.Inspector
Dim objActionsMenu As Office.CommandBarControl
Dim olResendMsg As OUTLOOK.MailItem
Dim ProfileN As String


' to find the right store or profile name
Dim colStores As OUTLOOK.Stores
Dim oStore As OUTLOOK.Store
Dim oRoot As OUTLOOK.Folder
' folder
Dim folders As OUTLOOK.folders
Dim Folder As OUTLOOK.Folder
Dim foldercount As Integer
Dim oFolder As OUTLOOK.Folder
 Set colStores = OUTLOOK.Application.Session.Stores
 
 For Each oStore In colStores
   y = oStore.DisplayName
 

    If y = "bookprice@xxxxx.com" Or y = "bookprice" Then
     
     Set oRoot = oStore.GetDefaultFolder(olFolderInbox)
     Set folders = oRoot.folders
         foldercount = folders.Count
'Check if there are any folders below oFolder
     Set myInbox = oRoot
     Set myitems = oRoot.Items


' ok we have records. generate records
t = "Action Required - Pricing Escalation #4196"






' search inbox for ID
Found = False

For Each myitem In myitems
       y = myitems.Count
        If InStr(1, myitem.Subject, "" & t & "") > 0 Then
          'MsgBox "Found" '  Debug.Print "Found"
            Found = True
             ' run the resend command
             Set objInsp = myitem.GetInspector
             objInsp.CommandBars.ExecuteMso ("ResendThisMessage")
            
             ' get the opened compose message form & send it
             
             Set olResendMsg = myitem 
            
             ' update fields if needed
             olResendMsg.CC = "redbookpriceescalations@grainger.com"
             olResendMsg.BCC = "david.powell@grainger.com"
             olResendMsg.Subject = "REMINDER: 2nd Request Please Respond : " & t & ""
             olResendMsg.Send
        Else
        ' do nothing
        End If
Next myitem
      

'If the subject isn't found:
       If Not Found Then
          ' NoResults.Show
          MsgBox "Pricing " & t & " Could Not Be Found. You will need to review Manually and send Notice."
          
       End If


If Found = True Then
 MsgBox "2ND Reminder Messages Sent !", vbOKOnly, "2nd Reminder Notice eMails"
End If

' this end if is for making sure we have the right profile name "Store" bookprice
  End If
Next


Set myNameSpace = Nothing
Set myInbox = Nothing
Set myitems = Nothing
Set myOlApp = Nothing

Open in new window

LVL 3
FordraidersAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

John TsioumprisSoftware & Systems EngineerCommented:
I am not sure but i think you should duplicate the email and then resend it....do you have a clue(breakpoint/watch) when the message gets deleted ?
0
FordraidersAuthor Commented:
I was also just changing the resend. To forward?
0
Anders Ebro (Microsoft MVP)Microsoft DeveloperCommented:
I believe that is the standard Outlook behavior. It does seem to make sense. Usually you would resend a message if the recipient didn't receive it. And then from a tracking point of view, the message is replaced with a new sent message.

One approach would be to forward the email. You might want to check if automatic forwarding modifies the title and/or adds indentation. That might not be desirable in your case.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Outlook

From novice to tech pro — start learning today.