We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

DOC styling in ASPOSE

Hi ,
here is the interop code for the doc styling :

Microsoft.Office.Interop.Word.Style ws = (Microsoft.Office.Interop.Word.Style) para.Range.get_Style();
StyleName = (ws == null ? "normal" : ws.NameLocal);

Need the ASPOSE replacement.Please assist.

please assist.

Hi Komal,

Thanks for your inquiry. The Style Class represents a single built-in or user-defined style. Please use the ParagraphFormat.Style property to get the paragraph style.

Document doc = new
Document(MyDir + "in.docx");
DocumentBuilder builder = new DocumentBuilder(doc);
Paragraph para= builder.CurrentParagraph;
Style style = para.ParagraphFormat.Style;

Moreover, the ParagraphFormat.StyleName property gets or sets the name of the paragraph style applied to this formatting. Please read following documentation links for your kind reference.
https://docs.aspose.com/words/net/working-with-styles-and-themes/

Hope this answers your query. Please let us know if you have any more queries.

Hi,
Is style name is differnet for aspose and interop??
Here i am putting one example:
for the line :
When am I eligible for the Plan?
Interop style name is : FP_Body Text Bold 10_Avenir Char
Aspose style naem is : FP_Tag Indicator
Please advise:
Regards,
Sitanshu

Hi Komal,

Thanks for your inquiry. Document.Styles returns a collection of styles defined in the document. Could you please attach your input Word document here for testing? I will investigate the issue on my side and provide you more information.