I need to be able to send attachments through the Send Mail method in VB Script. So I have read alot on this being done in C# but I need it in VB Script.
I have a need to verify a file attached using the file attachment control. How can I capture the file path of a file attached through a file attachment control?
Can I do this by stripping the file name and location from the Attch File control? If not, what about using a file picker? I have not been able to find one. I have been able to identify a file and successfully send it as an attachment through the send mail in vb script. Below is the code with a file hard coded. I really need a file picker though.
Set Outlook = CreateObject("Outlook.Application")
Set Message = Outlook.CreateItem(olMailItem)
Set myAttachments = Message.Attachments
myAttachments.Add "C:\temp\Carla.jpg", olByValue, 1, "Carla.JPG"
With Message
.Subject = emailsubject_IS
.Body = emailmessage
.Recipients.Add (email_IS)
.Recipients.Add (email_ITSRM)
If Len(aFrom) > 0 Then .Recipients.Add(aFrom).Type = olOriginator
.Send
End With
set message = nothing
set Outlook = nothing