Hi,
I am trying to add a spreadsheet to an email and came across a code on another thread on here that works really well.
The only problem is that it sends the original saved version of my spreadsheet.
My user will be opening my spreadsheet from an intranet page and the vba will need to save a temporary copy for the user. Is there a way to change the code below so it saves a temporary copy and attaches that to an email instead of the original
Sub Button9_Click()
Dim OlApp As Object
Dim OlMail As Object
Dim ToRecipient As Variant
Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.createitem(olMailItem)
For Each ToRecipient In Array("email.email.com", "Email2.email.com")
OlMail.Recipients.Add ToRecipient
Next ToRecipient
OlMail.subject = "Form" 'Subject field
OlMail.Attachments.Add ActiveWorkbook.FullName
OlMail.Display 'Display Email
End Sub
Thank You. Any help would be great
I am trying to add a spreadsheet to an email and came across a code on another thread on here that works really well.
The only problem is that it sends the original saved version of my spreadsheet.
My user will be opening my spreadsheet from an intranet page and the vba will need to save a temporary copy for the user. Is there a way to change the code below so it saves a temporary copy and attaches that to an email instead of the original
Sub Button9_Click()
Dim OlApp As Object
Dim OlMail As Object
Dim ToRecipient As Variant
Set OlApp = CreateObject("Outlook.Application")
Set OlMail = OlApp.createitem(olMailItem)
For Each ToRecipient In Array("email.email.com", "Email2.email.com")
OlMail.Recipients.Add ToRecipient
Next ToRecipient
OlMail.subject = "Form" 'Subject field
OlMail.Attachments.Add ActiveWorkbook.FullName
OlMail.Display 'Display Email
End Sub
Thank You. Any help would be great