Hi Im a newbie to this VB coding and need some help with some code I am usinf to try and take data from a form and email it to a workmate.I have left the fields from the form in begin with OTR , but I cant get the form field onto the email and now Ive started getting a run time error 287 application defined or object defined error and Im now lost in a forest of trees
Any help would be appreciated
Private Sub send_Click()
Dim strEmail, strBody As String
Dim objOutlook As Outlook.Application
Dim objEmail As Outlook.MailItem
Set objOutlook = CreateObject("Outlook.application")
Set objEmail = objOutlook.CreateItem(olMailItem)
'************************************************* *************
strEmail = "123456@btinternet.com"
strBody = strBody & "We have received a Request and are processing to issue promptly the following OTR Request" & _
" below to ensure our accuracy." & Chr(13) & Chr(13) & Chr(13)
strBody = strBody & "Client: " & OTRPartnership & "Site: " & OTRSite & Chr(13)
strBody = strBody & "Issue By: " & OTRStaff & Chr(13)
strBody = strBody & "Quantity: " & OTRQuant & Chr(13)
strBody = strBody & "Sequence: " & OTRSequence & Chr(13)
strBody = strBody & "OTR Purchase Number: " & OTRPONumber & Chr(13)
strBody = strBody & "Delivery Date: " & OTRDeliveryDate & Chr(13)
strBody = strBody & "Sincerely" & Chr(13) & Chr(13)
strBody = strBody & "" & Chr(13) & Chr(13)
With objEmail
.To = strEmail
.Subject = "New OTR Request"
.Body = strBody
.send
End With
Set objEmail = Nothing
objOutlook.Quit
Exit Sub
End Sub