Attach the most recent .XML file located at C:\Users\ then email
Help i am looking to attach the most recent .XML file located at C:\Users\Downloads\
then email the attachment
I have looked on forums but not found anything that worked.
Below is the basic setup for the rest of the email.
Private Sub MAIL_Click()
Dim OApp As Object
Dim OMail As Object
Dim signature As String
Set OApp = CreateObject("Outlook.Application")
Set OMail = OApp.CreateItem(0)
With OMail
.Display
End With
signature = OMail.body
With OMail
.To = ""
.Subject = ""
.Attachments.Add ("C:\Users\.xml")
.body = "FYI" & vbNewLine & signature
.Send
End With
On Error GoTo 0
Set OMail = Nothing
Set OApp = Nothing
End Sub
Any help is much appreciated :banghead: