File Attachment using VB Script - InfoPath Dev
in

InfoPath Dev

File Attachment using VB Script

Last post 06-15-2010 09:33 PM by martinpalmer. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-15-2010 09:33 PM

    File Attachment using VB Script

    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



    Filed under:
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.