Do you use SharePoint and Outlook?

I recently acquired an article and sample code from one of our Microsoft consultants, Ben Roscorla, to show how to create an Outlook add-in to support a functionally rich and yet visually consistent experience to attach SharePoint documents to an email message. The following is a summary of the main steps:

First, create a custom web view to display an HTML view of SharePoint content in a Common File Dialog (CFD). This customization applies to the server side in a SharePoint installation and can offer consistent customized experience to multiple Office client applications such as Excel, Outlook and Word. This custom web view allows the selection of a single document from a SharePoint site.

Then, extend the custom web view into a custom dialog in Outlook to provide a richer experience in attaching files to an email message. Use an Outlook add-in to integrate this experience with an Attach Document button in the inspector ribbon in compose mode.

 

Include a Windows form in the add-in project, and add a WebBrowser control so that when the user clicks the Attach Document button, the Windows form displays a dialog with the custom web view content. Behind the dialog, implement a rich experience by using extra query string parameters such as the Extensions parameter in the navigate function of the WebBrowser control. The rich experience includes:

  • Allowing multi-selection of documents
  • Allowing attaching or linking such documents to an email message
  • Providing version and document ID information in the filename to support traceability
  • And, at the same time, leveraging and providing an experience consistent with the CFD so to improve usability.

 

 

When the user selects items to attach in the dialog, the add-in attaches the selected documents and their versions to the email message. To support distinct versions of the same document, the add-in downloads each selected file locally as a file with the version information in its name.

The following is an example message where the user has attached documents as copies and as links in the message body.

 

Check out the details of each of these steps in Attaching Files from a Custom SharePoint Web View to an Outlook Message! Hope you will find this article useful!