Send to Outlook

Discuss and share scripts and script files...
Post Reply
binocular222
Posts: 1414
Joined: 04 Nov 2008 05:35
Location: Hanoi, Vietnam

Send to Outlook

Post by binocular222 » 07 Jan 2013 19:06

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
I'm a casual coder using AHK language. All of my xys scripts:
http://www.xyplorer.com/xyfc/viewtopic. ... 243#p82488

Emre
Posts: 13
Joined: 17 Feb 2016 07:14

Re: Send to Outlook

Post by Emre » 07 Dec 2018 09:56

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.

highend
Posts: 8302
Joined: 06 Feb 2011 00:33

Re: Send to Outlook

Post by highend » 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>"^^
One of my scripts helped you out? Please donate via Paypal or highend (at) web (dot) de

Emre
Posts: 13
Joined: 17 Feb 2016 07:14

Re: Send to Outlook

Post by Emre » 07 Dec 2018 10:48

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!

Post Reply