troubleshooting Question

trying to resend a message if text in the subject is found

Avatar of Fordraiders
FordraidersFlag for United States of America asked on
4 Comments1 Solution124 ViewsLast Modified:
outlook 2010
access 2010  vba

vba in access 2010

I'm searching inside the "Inbox" on a certain namespace
if it finds the text in the subject,

I get no errors but the emails are not sending.
I copied myself on the email, but i get no confirmation email ??

' trying for any mailbox under one profile here
Set myNameSpace = myOlApp.GetNamespace("MAPI")
Set myInbox = myNameSpace.Folders("bookprice")
Set myInbox = myInbox.Folders("Inbox")
Set myitems = myInbox.Items

Found = False

' for this question purpose 
t =  "Action Required - Pricing Escalation #4414"

For Each myitem In myitems
    If myitem.Class = olMail Then
       ' If InStr(1, myitem.Subject, "Action Required - Pricing Escalation #4414") > 0 Then
        'If InStr(1, myitem.Subject, "" & t & "") > 0 Then
        If 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
  ' delete these lines if you don't need to auto-edit or to auto-send it
             Set olResendMsg = myitem    'ActiveInspector.CurrentItem 'Application.ActiveInspector.CurrentItem

             olResendMsg.Subject = "REMINDER: 2nd Request Please Respond : " & t & ""
             olResendMsg.BCC = ""

Join our community to see this answer!
Unlock 1 Answer and 4 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 4 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros