I have a macro below to allow a user attach files in a folder C:\fixed assets
I need the code amended to attached specfic files for eg BR1 Fixed Assets.xls, Socom fixed Assets.xlsx etc
It would be appreciated if someone could kindly amend my code so as to attach specific files in C:\fixed assets
I need the code amended to attached specfic files for eg BR1 Fixed Assets.xls, Socom fixed Assets.xlsx etc
It would be appreciated if someone could kindly amend my code so as to attach specific files in C:\fixed assets
Code:
Sub Attachfiles_AndEmail()
ztext = [bodytext]
Zsubject = [subjectText]
Dim fName As String
Dim OutApp As Object
Dim OutMail As Object
Dim Strpath As String
Dim Strfile As String
Dim FD As Object
Dim vrtSelectedItem As Variant
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.createitem(0)
Set FD = Application.FileDialog(3)
With OutMail
.To = Join(Application.Transpose(Sheets("Macro").Range("N1:N2").Value), ";")
.CC = ""
.BCC = ""
.Subject = Zsubject
.Body = ztext
FD.AllowMultiSelect = True
FD.Filters.Clear
FD.Filters.Add "All Files", "*.*"
FD.InitialFileName = "C:\Fixed Assets\"
If FD.Show = True Then
For Each vrtSelectedItem In FD.SelectedItems
.Attachments.Add vrtSelectedItem
Next
End If
.Display
End With
Set OutMail = Nothing
Set OutApp = Nothing
End Sub