SIGN UP MEMBER LOGIN:    
ARTICLE

Overview and Concepts in Word Automation Services

Posted by Vijai Anand Articles | How do I January 06, 2011
In this article you will learn how to use Overview and Concepts in Word Automation Services.
Reader Level:

SharePoint 2010 introduces a service application called Word Automation Services. It is used for server side conversion of word documents into other file formats.

File types that word can open:

  • Open XML File Format documents (.docx, .docm, .dotx, .dotm).
  • Word 97-2003 documents (.doc, .dot).
  • Rich Text Format files (.rtf).
  • Single File Web Pages (.mht, .mhtml).
  • Word 2003 XML Documents (.xml).
  • Word XML Document (.xml).

File types that word can save:

  • Portable Document Format (PDF) files.
  • XML Paper Specification (XPS) files.
  • Open XML File Format documents (.docx, .docm, .dotx, .dotm).
  • Word 97-2003 documents (.doc, .dot).
  • Rich Text Format files (.rtf).
  • Single File Web Pages (.mht, .mhtml).
  • Word 2003 XML Documents (.xml).
  • Word XML Document (.xml).

Word Automation Service is a part of SharePoint 2010. Word Automation Service is available in the Standard edition and in the Enterprise edition. It is a feature of SharePoint 2010, so SharePoint 2010 should be purchased and installed to use Word Automation Services.

For Word Automation Services Architecture refer http://msdn.microsoft.com/en-us/library/ee556832.aspx.

For the concepts that are basic for Word Automation Services refer my previous article named Concepts in Word Automation Services.

Using C# code you can convert the word documents into different formats. There are three different ways for converting the received word documents into other formats.

  • AddFile ()
  • AddFolder()
  • AddLibrary()

For AddFile() method refer http://www.c-sharpcorner.com/UploadFile/anavijai/4816/Default.aspx.

For AddFolder() method refer http://www.c-sharpcorner.com/UploadFile/anavijai/4823/Default.aspx.

For AddLibrary() method refer http://www.c-sharpcorner.com/UploadFile/anavijai/4822/Default.aspx.

Using powershell you can use Word Automation Services to convert the word document into other formats. Refer http://www.c-sharpcorner.com/UploadFile/anavijai/4820/ and http://www.c-sharpcorner.com/UploadFile/anavijai/4801/Default.aspx.

The following concepts are basic for Word Automation Services:

  • Conversion
  • Conversion Job
  • Document Queue

Conversion:

Conversion in Word Automation Services is a process of converting the word document to other formats. For example converting .doc file format to .pdf format. It constitutes of the following steps:

  • Create a conversion job

    ConversionJob job = new ConversionJob("Word Automation Services");
     
  • Set the desired output file format

    job.Settings.OutputFormat = SaveFormat.PDF;
     
  • Add files to the conversion job

    AddFile ()


    Syntax:

    job.AddFile(string inputFile, string outputFile)

    Example:

    job.AddFile("http://serverName:31829/sites/Home/Shared%20Documents/ArticleLinks.docx","http://serverName:31829/sites/Home/Shared%20Documents/ArticleLinks.pdf");

    AddFolder ()

    Syntax:

    job.AddFolder(SPFolder inputFolder,SPFolder outputFolder,bool recursion);

    AddLibrary ()

     Syntax:

    job.AddLibrary(SPList inputList,SPList outputList);

  • Submit the job to the document queue

    job.Start();

Conversion Job:

Conversion job describes the files to be converted and the operation to perform on them.
Each file is considered to be a conversion item, and the conversion item will be mapped to Conversion job. Conversion job contains one or more conversion items.

Document Queue:

Document Queue is a "first in, first out", which is used to start the conversion and that schedule can be set in the conversion job.

Login to add your contents and source code to this article
share this article :
post comment
 
Nevron Gauge for SharePoint
Become a Sponsor
PREMIUM SPONSORS
  • Finally – a virtual platform that delivers next-generation Windows Server 2008 Hyper-V virtualization technology from a managed hosting partner you can truly depend on. Visit www.maximumasp.com/max for a FREE 30 day trial. Hurry offer ends soon. Climb aboard the MaxV platform and take advantage of High Availability, Intelligent Monitoring, Recurrent Backups, and Scalability – with no hassle or hidden fees. As a managed hosting partner focused solely on Microsoft technologies since 2000, MaximumASP is uniquely qualified to provide the superior support that our business is built on. Unparalleled expertise with Microsoft technologies lead to working directly with Microsoft as first to offer IIS 7 and SQL 2008 betas in a hosted environment; partnering in the Go Live Program for Hyper-V; and product co-launches built on WS 2008 with Hyper-V technology.
    Get 2 Months Free of ASP.NET Hosting for Only $4.95/month! Receive FREE MS SQL and MySQL Databases Including ASP.NET 4/3.5, MVC 3.0, Silverlight 4, Windows 2008/IIS 7.0 Plus FREE IIS 7 Modules. Host UNLIMITED ASP.NET Web Sites - Click Here!
6 Months Free & No Setup Fees ASP.NET Hosting!
Become a Sponsor