The following thread allows you to email selected files with Outlook, however, it only allows send (1) file at a time.
To correct this issue, you would create a .vbs file with the code below, then create a shortcut that you place into your windows send to folder. Thus when you right click the selected file(s), you can click send to and select the shortcut.
The following code works on multiple file selections.
I'm trying to implement this within Directory Opus instead of the Send To context menu, but not sure how to do it.
- I'm looking to create a button on my toolbar that will run this script on my selected files. Identical to the current button on Directory Opus, but it uses Outlook instead Directory Opus.
- I would also like to store the .vbs and shortcut file in my E:\Documents ILO the SendTo folder to prevent administrative issues.
I have tried moving the files and creating a button, but for some reason it is not recognizing the selection and creates an email with no attachments.
Option Explicit Dim objArgs, OutApp, oNameSpace, oInbox, oEmailItem, olMailItem Dim a, oAttachments, subjectStr, olFormatHTML Dim objFSO,strSigFilePath, objSignatureFile, strBuffer olMailItem = 0 olFormatHTML = 2 Set objArgs = WScript.Arguments 'gets paths of selected files Set OutApp = CreateObject("Outlook.Application") 'opens Outlook Set oEmailItem = OutApp.CreateItem(olMailItem) 'opens new email For a = 0 to objArgs.Count - 1 Set oAttachments = oEmailItem.Attachments.Add(objArgs(a)) subjectStr = subjectStr & Right(objArgs(a),Len(objArgs(a))-(InStrRev(objArgs(a),"\"))) & "<br/>" Next If subjectStr = "" then subjectStr = "No Subject " oEmailItem.Subject = "" oEmailItem.BodyFormat = olFormatHTML oEmailItem.HTMLBody = "<body style='font-family:calibri;font-size:14.5px'>" & "<br/><br/>" & "<b><u>Attached files:</b></u><br/>" & Left(subjectStr, len(subjectStr)-2) & ". " & strBuffer & "</body>" oEmailItem.Display