Friday, March 13, 2009

Office Development with Visual Studio : Deploying Documents to a SharePoint Document Library (Mary Lee)

 

Deploying Documents to a SharePoint Document Library (Mary Lee)

Published 13 March 09 04:56 PM

When you are done developing your customized Microsoft Excel 2007 or Microsoft Word 2007 workbook project in Visual Studio 2008, you may want to publish it to a SharePoint document library for others to use from the SharePoint site, or they can copy the file from the site to their desktop to use locally. In either case, the customization assembly cannot be stored in the SharePoint document library, so you have to configure the workbook to store the assembly on a file share.

In Solution Explorer, right-click the Excel document-level project, and then click Publish. You'll see the Publish Wizard appear.

In the first page of the Publish Wizard, type the folder name where you want Visual Studio to copy the files, known as the publish location. In this case, it's a subfolder of the project folder.

image

In the second page of the Publish Wizard, type the folder name where the installation files will be located. In this example, the installation files are located on a configure the workbook to look for the assembly on a file share, known as the install location.

image

Note: You could have set the publish location to this file share in step 1 if you have access rights to the file share. Setting the install location separate from the publish location allows you to publish the files locally and then hand the files over to an IT administrator to upload the files to a file share.

The third and last page of the Publish Wizard is a summary of the publish options.

image

Copy the publish folder from step 1 to the file share, and upload the Excel workbook file to a SharePoint document library.

image

The final step is to trust the location of the SharePoint document library to the Trusted Location in Excel.  Copy the URL of the SharePoint document library and remove the last Forms/Allitems.aspx text from the URL.  For example, if your SharePoint document library is http://sharepoint/sites/writers/SampleDocLibrary/Forms/AllItems.aspx, the location to add to Excel is http://sharepoint/sites/writers/SampleDocLibrary.

1. Open Excel.

2. Click the Microsoft Office button. 

3. Click Excel Options.

4. Click Trust Center.

5. Click Trust Center Settings.

6. Click Trusted Locations.

7. Check Allow Trusted Locations on my network.

8. Click Add new location.

9. In the Microsoft Office Trusted Location dialog box, in the Path textbox, type or paste the URL to the SharePoint document library. In this example, it's http://sharepoint/sites/writers/SampleDocLibrary.

10. Click OK to close the Microsoft Office Trusted Location dialog box.

11. Click OK to close the Trust Center dialog box.

12. Click OK to close the Excel Options dialog box.

Finally, open the Excel workbook file from the SharePoint document library. This starts the installation process for the Excel solution. Depending on the security settings, you may see the Microsoft Office Customization Installer dialog box prompting you to install the Excel solution.

This is the blog version of the following topic in the MSDN Library: How to: Deploy a Document-Level Office Solution to a SharePoint Server (2007 System). You can also see the video demonstration at Video How to: Deploy a Document-Level Office Solution to a SharePoint Server (2007 System)

Happy deployment!

Mary Lee, Programming Writer.

by VSTO Team

Office Development with Visual Studio : Deploying Documents to a SharePoint Document Library (Mary Lee)

No comments:

Blog Archive