I want to define a paragraph style and use it to format a paragraph in the generated Word document. Here is the code I use:
Document Doc=new Document();
//The following line makes the “testStyle” style disappear in the generated doc
DocumentBuilder db=new DocumentBuilder(Doc);
When I uncomment the lines that sets the ‘bold’ property in the ‘font’ object of the ‘testStyle’ style object, and regenerate the document: the generated paragraph does not have any style defined, and none of the formatting I specified in the ‘testStyle’ style were applied.
Can you reproduce this ? If yes, is my code wrong ?
I use Word 2003 to view the generated documents (they are generated in the .doc format).
The same behavior occurs if I set the ‘Color’ property instead of the ‘Bold’ property (I did not try any other properties, but I guess this happens for all properties of the ‘Font’ object)