Page tree

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Intro

This demo shows how to open an existing Excel workbook and programmatically edit properties of existing charts with OfficeWriter.  Select the major product categories you would like to see in the report.  The SeriesCollection of the existing chart will be changed at runtime to reflect the number and types of categories you chose.

Code

Excerpt

Dynamically place custom watermarks on a Word document using the WordApplication object.

This sample uses the WordApplication object to insert watermarks onto a template document.

Code

Code Block
//The value of this string is the watermark
string watermark = "Classified";

public void GenerateDocument()
{
 // Create an instance of the WordApplication object 
 WordApplication wwApp = new WordApplication();

 // Open document without watermark 
 Document doc = wwApp.Open(@"..\..\WordTemplateFiles/PreWatermark.doc");

 // Set the watermark 
 doc.Watermark.Text = watermark;

 // Save the document to the Response stream 
 wwApp.Save(doc, @"..\..\WordOutputFiles\Watermarked_out.doc");
}

Downloads

Initial Document: PreWatermark.doc

Output: Watermark_out.doc