SemiHidden in Styles shows different value

Hi,

I used following code to read the SemiHidden property from 2 documents:

Aspose.Words.License lic = new Aspose.Words.License();
lic.SetLicense("Aspose.Total.NET.lic");

Aspose.Words.Document doc = new Aspose.Words.Document("10747-CH1.docx");
Boolean isSemiHidden = doc.Styles["Balloon Text"].SemiHidden;

Aspose.Words.Document doc2 = new Aspose.Words.Document("10747-Default.dotx");
Boolean isSemiHidden2 = doc2.Styles["Balloon Text"].SemiHidden;

documents.zip (65.3 KB)

In both document, I have hide the style ‘Balloon Text’ from the Styles gallery and from the Styles task pane but only in one it shows SemiHidden == true.

Can you explain what is the difference ?

Kind regards,

@Nachti If you check the styles in the attached documents, you can see that in 10747-CH1.docx, the Balloon Text is explicitly defined and has semiHidden property set:

<w:style w:type="paragraph" w:styleId="Sprechblasentext">
	<w:name w:val="Balloon Text"/>
	<w:basedOn w:val="Standard"/>
	<w:link w:val="SprechblasentextZchn"/>
	<w:uiPriority w:val="99"/>
	<w:semiHidden/>
	<w:unhideWhenUsed/>
	<w:rsid w:val="002D6681"/>
	<w:rPr>
		<w:rFonts w:ascii="Segoe UI" w:hAnsi="Segoe UI" w:cs="Segoe UI"/>
	</w:rPr>
</w:style>

In the 10747-Default.dotx, however, the style is not defined explicitly, i.e. it is a latent style and Aspose.Words creates it on demand.

How can I set the style explicitly for 10747-Default.dotx in Word directly ?

@Nachti You can use the style in your template or modify it. In this case the style should be explicitly defined in the document.