Page 1 of 1

Send to Outlook

Posted: 07 Jan 2013 19:06
by binocular222
When you right click files → Send to → Mail recepient:
- New mail appear with these files attached (but email is formatted as pain text and no signature!)
- Too many clicks

The script:

Code: Select all

On Error Resume Next
Set AppItem = CreateObject("Outlook.Application").CreateItem(0)
For each FileItem in WScript.Arguments
	AppItem.Attachments.Add FileItem
	BaseName = Right(FileItem,Len(FileItem) - InStrRev(FileItem,"\"))
	MessageSubject = MessageSubject & "; " & BaseName
Next

AppItem.BodyFormat = 2
AppItem.Subject = Right(MessageSubject,Len(MessageSubject)-2)
AppItem.Display
AppItem.HTMLBody = "FYI" & AppItem.HTMLBody
+Save as "Send to Outlook.vbs"
+ Open selected file with "Send to Outlook.vbs"
+ Tips: You can customize this line in PFA:

Code: Select all

|"Send to Outlook|<xypath>\icon\Outlook.ico" *>E:\7Utilities\XYplorer\Scripts\Send to Outlook.vbs
Now, everytime you need to send some files to Outlook, just Ctrl+Enter and select "Send to Outlook"

Update 12-Feb-13:
+ New mail's subject lists the name of all attached files (with extension)
+ New mail's body has default word "FYI". Of course you can easily customize to another word

Re: Send to Outlook

Posted: 07 Dec 2018 09:56
by Emre
Hi,
Thanks for the script. I know it is an old thread, sorry about that.
This would help me very much in daily work.

But I could not get it to work now. I created a new "open with" item in catalog, pointing to your vbs script. It opens outlook and creates the mail template, but it does not add the file selected.

Windows/ office being in Turkish language or files being on server may cause any errors?

Thanks alot, Emre.

Re: Send to Outlook

Posted: 07 Dec 2018 10:21
by highend
Try it with "Go to Location" instead of "Open Item"
and use this script in the "Location:" line:

Code: Select all

::$s = quote(<get SelectedItemsPathNames '" "'>); run """cscript"" ""<path to the .vbs file>\Send to Outlook.vbs"" $s";
Ofc you need to adapt "<path to the .vbs file>"^^

Re: Send to Outlook

Posted: 07 Dec 2018 10:48
by Emre
highend wrote: 07 Dec 2018 10:21 Try it with "Go to Location" instead of "Open Item"
and use this script in the "Location:" line:

Code: Select all

::$s = quote(<get SelectedItemsPathNames '" "'>); run """cscript"" ""<path to the .vbs file>\Send to Outlook.vbs"" $s";
Ofc you need to adapt "<path to the .vbs file>"^^
Thanks alot, it is working now!