The context menu itself is a JavaScript program and you can found it at \Program Files\Common Files\Microsoft Shared\web server extensions\60\TEMPLATE\LAYOUTS\1033\ows.js
There’s a script that out-of-the-box available to check whether there’s a customization applied.
if (typeof(Custom_AddDocLibMenuItems) != “undefined”)
{
if (Custom_AddDocLibMenuItems(m, ctx))
return;
}
So, the idea here is the override the Custom_AddDocLibMenuItems with our own script. You can add the script using the Content Editor Web Part, (you may want to clear the “Visible on The Page” option as it only contain our script. Choose the source editor and add this script to modify the context menu of Sharepoint.
<script language="javascript">function Custom_AddDocLibMenuItems(m, ctx){var strDisplayText = "Kirim melalui Email..."; var strAction; var strImagePath = "";// parse the URL out of the itemTablevar URL = "";var index = itemTable.innerHTML.indexOf("href=");if (index > 0) { var str = itemTable.innerHTML.substr(index + 6); index = str.indexOf('"'); if (index > 0) { URL = str.substr(0, index); }}if (URL != ""){ strAction = 'window.navigate("mailto:%20?subject=Take a look at this document...&body=<' + URL + '>")';
// Add menu item CAMOpt(m, strDisplayText, strAction, strImagePath); // add a separator to the menu CAMSep(m); }return false; }</script>
The script only send the link of the document, you need to find the Jscript to attach the document as well. You can use the alternative and detailed documentation on customizing SPS is in Sharepoint Product & Technologies SDK (http://msdn.microsoft.com/library/en-us/odc_2003_ta/html/sharepoint.asp) and http://blogs.msdn.com/marioha/
_____________Mario Hadiwinata MCSD, MCDBA, MCSE, MBS Certified Professional CRM - Partner Technology Specialist | Microsoft Indonesiamarioha@microsoft.com | (62-21) 2551-8176