Don't think there's any reason for having those API calls in your code, unless you know it is there for a certain reason.
So here's what I think you are after.
Code:Sub TicketResolved() Dim myOlApp As Object 'Outlook.Application Dim MyItem As Object 'Outlook.MailItem Dim Lastfirstname1 As String Lastfirstname1 = "SOMETHING" Set myOlApp = CreateObject("Outlook.Application") While Not IsEmpty(Cells(3, 3)) Set MyItem = myOlApp.CreateItemFromTemplate("C:\OPEN -ALL\TICKET RESOLVED\Ticket Resolved Template") With MyItem .To = Cells(3, 2) & "; forums1167@gmail.com" .Subject = "Ticket Resolved #" & Cells(3, 1) .HTMLBody = Replace(.HTMLBody, "Issue1", Cells(3, 1)) .HTMLBody = Replace(.HTMLBody, Lastfirstname1, Cells(3, 2)) .Display End With Set MyItem = Nothing Set myOlApp = Nothing Rows("3:3").Delete Shift:=xlUp Wend End Sub




Reply With Quote
Bookmarks