Hello I have amended my spreadsheet address to attach files from SharePoint rather than a local file into an email; unfortunately it is adding %20 into the spaces. of the filename. Any ideas how to stop this
thanks
VBA Code:
Sheets("NidsBreaks (2)").Select
Dim OutLookApp As Object
Dim OutLookMailItem As Object
Dim LastRow As Long
Dim MailDest As String
Dim subj As String
LastRow = ThisWorkbook.Worksheets("Reports (2)").Cells(Rows.Count, "A").End(xlUp).Row 'change worksheet
For i = 2 To LastRow
Set OutLookApp = CreateObject("Outlook.application")
Set OutLookMailItem = OutLookApp.CreateItem(0)
Set Attach = OutLookMailItem.Attachments
With OutLookMailItem
.SentOnBehalfOfName = "x@x.co.uk"
.To = "x@x.co.uk"
'.cc = "x@x.co.uk"
.Subject = Cells(i, 10).Value
.body = Cells(i, 11).Value
Attach.Add Cells(i, 5).Value
Attach.Add Cells(i, 6).Value
.display
'SendKeys "^{ENTER}"
End With
'SendKeys "^{ENTER}"
Next
'Call yes_no_msg
End Sub