Hi All,
I am new to this forum.
I have downloaded the Evaluation or trail version of AsposeWord for java i am able to run my example ,its very good one.
i am reading a existing MS-Word file and creating new file and pasting all the contents also i am adding new text like helloworld and i am trying to read existing style into Style class and it will be good if i can apply same style to my text but i am not able to do this.its coming in red color.
can you please help me.
Here is the the code
StyleCollection styleCollection = sourceDoc.getStyles();
Style oldStyle = null;
for (Style style : sc)
{
System.out.println("style name :" + style.getName());
if (style.getName().equalsIgnoreCase("Test - helloStyle"))
{//Test - hello is the style name which is coming from above systm.out.println
oldStyle = style;
}
}
DocumentBuilder builder = new DocumentBuilder(dstDoc);
builder.getListFormat().setList(oldStyle.getList());
builder.writeln("welcome :" + "test123");
String s = oldStyle.getName();
builder.writeln("Hello World: " + s + ", bulleted.");
builder.getDocument().save("c:\\test\\" + "Test1.doc");
/////
i am getting the output but its coming in redcolor on the top of the document where but my style is in different color.
Evaluation Only. Created with Aspose.Words.
Copyright 2003-2008 Aspose Pty Ltd.
welcome: test123
Hello World: Test - helloStyle, bulleted.
Evaluation Only. Created with Aspose.Words. Copyright 2003-2008 Aspose Pty Ltd.
is it coming due to i am using Evaluation version.thanks in advance.
Thanks,
Susant