Hey Everyone!
Can't seem to figure this one out for the life of me. I click submit, an e-mail is generated, the macro takes value's from text boxes in user form to create the "To", "Subject" & "Body" fields, but I also need it to attach the file listed in the PO text box (txtsspo.value). I've tried attachment.add and .attachment = "bla bla bla".
Not working, but the code doesn't error out either. Any suggestions?
Can't seem to figure this one out for the life of me. I click submit, an e-mail is generated, the macro takes value's from text boxes in user form to create the "To", "Subject" & "Body" fields, but I also need it to attach the file listed in the PO text box (txtsspo.value). I've tried attachment.add and .attachment = "bla bla bla".
Not working, but the code doesn't error out either. Any suggestions?
Code:
Dim oOLook As Object
Dim oEMail As Object
Set oOLook = CreateObject("Outlook.Application")
oOLook.Session.Logon
Set oEMail = oOLook.CreateItem(0)
oEMail.Display
On Error Resume Next
With oEMail
.Importance = olImportanceHigh
.To = txtVendEML.Value
.CC = ""
.BCC = ""
.Attachment = "C:\Users\User\OneDrive - Company name llc\PO's\" & txtSSPO.Value '<----- NEED HELP HERE
.Subject = " PO# " & txtSSPO.Value
.Body = "Hi," & vbNewLine & "Attached is PO# " & txtSSPO.Value & "." & vbNewLine & _
"Please confirm estimated ship date, and your order # when you have a moment. Thank you and have a great day!" & vbNewLine & "Thanks," & vbNewLine & drpUserSingle.Value
End With