// Create a new instance of the WordDocumentWriter class
// using the static 'Create' method.
// After writing content, this instance must be closed.
WordDocumentWriter wordDocWriter = WordDocumentWriter.Create(@"C:\Samples_Projects\GridDataInWord.docx");
// Start a Word Document.
// This must be balanced with a corresponding call to EndDocument.
wordDocWriter.StartDocument();
// Begin a paragraph. This must be
// balanced with a corresponding call to EndParagraph.
wordDocWriter.StartParagraph();
// Create a new instance of the Font class
Infragistics.Documents.Word.Font font = wordDocWriter.CreateFont();
font.Bold = true;
font.Underline = Underline.Thick;
font.ForeColor = Color.Red;
// Add text with predefined font to a paragraph
wordDocWriter.AddTextRun("Products", font);
wordDocWriter.AddNewLine();
// End paragraph
wordDocWriter.EndParagraph();
// Call the Export method on WinGridWordWriter and
// pass the Grid control and WordDocumentWriter object as parameters.
this.ultraGridWordWriter1.Export(ultraGrid1, wordDocWriter);
wordDocWriter.AddEmptyParagraph();
wordDocWriter.StartParagraph();
// Add text with predefined font to a paragraph
wordDocWriter.AddTextRun("Categories", font);
wordDocWriter.AddNewLine();
wordDocWriter.EndParagraph();
//Export the second Grid to Word
this.ultraGridWordWriter1.Export(ultraGrid2, wordDocWriter);
// End the Document
wordDocWriter.EndDocument();
// Close the writer and finalize content
wordDocWriter.Close();