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

Free Support Forum - aspose.com

How can i use exactly word builtin style?

my parter get me a file, which look like using custom style, please look the picture1, then i use aspose to detech it, but after check out, all of the using style is built-in style.

picture 1

picture 2:built-in style

but i don’t think this is built-in style, it looks like obviously different between the built-in style, please look the picture2 which exactly is the built-in style.

another interesting scenes, please look the below picture:

total document style count

actual style count

show total count 24, but actually has 277, it is strange.

Hi Pyntia,

Thanks for your inquiry.

*sendreams:
my parter get me a file, which look like using custom style, please look the picture1, then i use aspose to detech it, but after check out, all of the using style is built-in style.

but i don’t think this is built-in style, it looks like obviously different between the built-in style, please look the picture2 which exactly is the built-in style.*

Could you please share some more detail about your query? What exact you want to achieve by using Aspose.Words. We will then provide you more information about your query along with code.

Please note that formatting is applied on a few different levels. For example, let’s consider formatting of simple text. Text in documents is represented by Run element and a Run can only be a child of a Paragraph. You can apply formatting 1) to Run nodes by using Character Styles e.g. a Glyph Style, 2) to the parent of those Run nodes i.e. a Paragraph node (possibly via paragraph Styles) and 3) you can also apply direct formatting to Run nodes by using Run attributes (Font). In this case the Run will inherit formatting of Paragraph Style, a Glyph Style and then direct formatting.

I suggest you please read following documentation links for your kind reference.
https://docs.aspose.com/words/net/applying-formatting/

Please use the ParagraphFormat.Style gets or sets the paragraph style applied to this formatting.

*sendreams:
another interesting scenes, please look the below picture:

total document style count

actual style count

show total count 24, but actually has 277, it is strange.*

I have tested the scenario and have managed to reproduce the same issue at my side. For the sake of correction, I have logged this problem in our issue tracking system as WORDSNET-9869. I have linked this forum thread to the same issue and you will be notified via this forum thread once this issue is resolved.

We apologize for your inconvenience.

hi, Tahir

thank you for your reply

the information you provide is helpful for me.

another question: if heading paragraph’s style can effect by different level setting, is any way clear all descendant setting,
than set the heading paragraph to built-in style?

is this api can do all these work for me?
Paragraph.ParagraphFormat.Style = builtinstyle;

hi, Tahir

i almost understand the style mechanism, then i will waiting the bug repaired.

thanks again.

Hi Pyntia,

Thanks for your inquiry.

*sendreams:
another question: if heading paragraph’s style can effect by different level setting, is any way clear all descendant setting,
than set the heading paragraph to built-in style?

is this api can do all these work for me?
Paragraph.ParagraphFormat.Style = builtinstyle;*

Please use the ParagraphFormat.ClearFormatting to clear the existing formatting of a paragraph. This method resets to default paragraph formatting. Default paragraph formatting is Normal style, left aligned, no indentation, no spacing, no borders and no shading.

sendreams:
I almost understand the style mechanism, then i will waiting the bug repaired.

We will update you via this forum thread once this issue issue is resolved.

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.

Hi Pyntia,

Thanks for your patience.

It is to inform you that our development team has completed the work on the issue (WORDSNET-9869)
and has come to a conclusion that this issue and the
undesired behavior you’re observing is actually not a bug in
Aspose.Words.

If you want to iterate through only unique styles in a document, it must use the “for” statement instead of “foreach”. Please let us know if you have any more queries.

Document doc = new Document(MyDir + "in.docx");
StyleCollection styles = doc.Styles;
for(int i = 0; i < styles.Count;i++)
{
    Console.WriteLine(styles[i].Name);
}

hi, Tahir

thank you very much.

the solution is a bit strange for user although it can work, i don’t think for and foreach has diff output can be understand by user. maybe should do a redesign for this api.

thanks

Hi Pyntia,

Thanks for your inquiry.

We are in communication with our development team about your query and will get back to you as soon as possible.

Hi Pyntia,

I have received response from our development team about your issue and like to share with you that your document have style alias e.g Heading 7,PIM 7,l7. In this case, the actual style’s name is “Heading 7”, after that goes a comma-separated list of style “aliases”. In fact, comma separated style name is cosmetic convention used in Microsoft Word’s user interface style names.

So, in this case, please use the “for” statement instead of
“foreach”. Hope this answers your query. Please let us know if you have any more queries.

hi, Tahir

thanks a lot about this, your service is professinal.

Hi Pyntia,

Please feel free to ask if you have any question about Aspose.Words, we will be happy to help you.