Code Sample: Custom Web Part and Word Add-in

Applies to: SharePoint Server 2010

The Custom Web Part and Word Add-in sample solves a presentation limitation of the external list by enabling the hierarchical display of items in the client from an external Document Management System (DMS) by using Microsoft Business Connectivity Services (BCS).

Because the external list has a flat structure, all items in the list are displayed in rows, with no visual way to distinguish child items beneath parent items in the view. With this sample, you can view the items from the external system in a tree-like structure through a Microsoft Word add-in or a Business Data Web Part. This sample shows how to recreate folder hierarchies, paging, and document downloading from the external DMS.

The sample includes a .NET Assembly Connector for accessing the external DMS, a Web Part for displaying the folders and files on the server, and a Microsoft Office add-in for working with the files on the client.

Prerequisites for the server solution:

  • Internet Information Services (IIS)

  • Microsoft .NET Framework 3.5 Service Pack 1

  • Microsoft SharePoint Server 2010

  • Microsoft SQL Server 2008

  • Microsoft Visual Studio 2010 installed on the same computer as SharePoint Server 2010

Prerequisites for the client solution:

  • Microsoft .NET Framework 3.5 Service Pack 1

  • Microsoft Office development tools in Microsoft Visual Studio 2010

  • Microsoft Office Professional Plus 2010

Download and use the sample

  1. Download the Microsoft SharePoint 2010 Software Development Kit (SDK) from SharePoint 2010 Reference: Software Development Kit.

  2. Extract "bcs sample from the path %ProgramFiles%\Microsoft SDKs\SharePoint 2010\Samples\Business Connectivity Services to a local folder.

  3. In the folder where you extracted the files, locate the Custom Web Part and Word Add-In Sample folder and open the Readme.htm file.

  4. Follow the instructions in Readme.htm to use the sample.