You can use aspose. Cells to add special text effects to a workbook. For example, you can stretch the title, modify the text, make the text conform to the preset shape, or add a watermark effect to the workbook.
The following example shows how to use the Simple API provided by aspose. Cells to add watermarks to a worksheet.
ExampleCode:
C #
// Instantiate a new workbookworkbook workbook = new Workbook (); // get the first default sheetworksheet sheet = workbook. worksheets [0]; // Add watermarkaspose. cells. drawing. shape wordart = sheet. shapes. addtexteffect (msopresettexteffect. texteffect1, "confidential", "Arial black", 50, false, true, 18, 8, 1, 1,130,800); // get the Fill Format of the word artmsofillformat wordartformat = wordart. fillformat; // set the colorwordartformat. forecolor = system. drawing. color. red; // set the transparencywordartformat. transparency = 0.9; // make the line invisiblemsolineformat lineformat = wordart. lineformat; lineformat. isvisible = false; // Save the fileworkbook. save ("E: \ Test2 \ watermarkt_test.xls ");
[VB]
'Instantiate a new workbookdim workbook as new Workbook () 'get the first default sheetdim sheet as worksheet = workbook. worksheets (0) 'add watermarkdim wordart as aspose. cells. drawing. shape = sheet. shapes. addtexteffect (msopresettexteffect. texteffect1, "confidential", "Arial black", 50, false, true, 18, 8, 1, 1,130,800) 'Get the Fill Format of the word artdim wordartformat as msofillformat = wordart. fillformat 'set the colorwordartformat. forecolor = system. drawing. color. red'set the transparencywordartformat. transparency = 0.9 'make the line invisibledim lineformat as msolineformat = wordart. lineformatlineformat. isvisible = false 'Save the fileworkbook. save ("E: \ Test2 \ watermarkt_test.xls ")