Step 1: Set Up the Visual Studio 2010 Project for the Workflow Archive to XPS

Applies to: SharePoint Server 2010

This topic shows how to modify a SharePoint Server 2010 content type and set up the Microsoft Visual Studio 2010 project for the Word Automation Services solution.

Setting Up the Project

In the first procedure of this topic, you configure a SharePoint Server 2010 document library for the input and output documents of a Word Automation Services conversion job.

To modify the Document Content Type

  1. From the SharePoint site where the Document Library is located, click Site Actions and then click Site Settings.

    Note

    This walkthrough assumes that you have created a SharePoint site that contains a Shared Documents library. This library will be referenced in the Creating the Project procedure later in this topic.

  2. Under the Galleries, click Site content types.

  3. Under Document Content Types, click Document to edit its content type. The Word Automation Services solution that you create in this walkthrough uses the Document content type.

  4. Under Columns, click Add from existing site columns.

  5. In Available Columns, scroll to Status. Select Status and then click Add.

    Note

    If Status does not appear in Available Columns, it may have already been added to the Document content type.

  6. Click OK to add the Status column to the Document content type.

After modifying the Document content type, the next step is to create the Visual Studio 2010 project for the Word Automation Services solution.

To create the Visual Studio 2010 Sequential Workflow project

  1. Start Visual Studio 2010 as an administrator.

    Important

    You must start Visual Studio 2010 as an administrator in order to successfully publish the project to the SharePoint 2010 farm.

  2. Click File, point to New, and then click Project…

  3. In the New Project dialog box, under Installed Templates, expand Visual C# (if it is not already expanded), expand SharePoint, and then click 2010.

  4. In the list of template types, select Sequential Workflow.

  5. Give the project a name, for example, ArchiveDocument.

  6. Click OK to create the project.

  7. On the Specify the site and security level for debugging page of the SharePoint Customization Wizard verify the SharePoint site for the solution.

  8. On the Specify the site and security level for debugging page of the SharePoint Customization Wizard, select Deploy as a farm solution.

    Important

    You must select the option Deploy as a farm solution because the Word Automation Services object model cannot be accessed from partly trusted code.

  9. On the Specify the workflow name for debugging page of the SharePoint Customization Wizard, give the workflow an easily recognizable name, for example, Archive Document.

  10. Select List Workflow for the workflow template and then click Next.

  11. On the Select the lists you will use when you debug page of the SharePoint Customization Wizard, leave the default associations and then click Next.

    Note

    If you want to attach the workflow to a specific list on the SharePoint site, select that list on The library or list to associate your workflow with:. This walkthrough associates the workflow with a Shared Documents library.

  12. On the Specify the conditions for how your workflow is started page of the SharePoint Customization Wizard, leave the default settings under How do you want the workflow to start?.

  13. Click Finish to create the project.

After creating the Visual Studio 2010 project, the next step is to write code to create a workflow that performs a Word Automation Services document conversion. To use the Word Automation Services object model in code, add a reference to the Word Automation Services assembly.

To add a reference to Word Automation Services

  1. In Solution Explorer, right-click References and then click Add Reference…

  2. In the Add Reference dialog box, click the Browse tab. The Microsoft.Office.Word.Server.dll assembly is located in the SharePoint Server 2010 \ISAPI folder, which usually has the following path:

    %systemdrive%:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI

  3. Select Microsoft.Office.Word.Server.dll and then click OK to add the reference.

    Note

    If you receive a warning that Microsoft.Office.Word.Server.dll requires a newer version of the .NET Framework, click Yes to add the reference. Then, add a reference to System.Web.DataVisualization, which usually has the following path:

    %windir%\Assembly\GAC_MSIL\System.Web.DataVisualization\3.5.0.0__31bf3856ad364e35\

See Also

Other Resources

Programming Word Automation Services