Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Wed Oct 11, 2017 8:08 am

Hello,

I'm trying to apply a style to my paragraph,
like that:

Code: Select all
Paragraph paragraph = new Paragraph(this.doc);
paragraph.AppendText("Description");
paragraph.ApplyStyle("Titre 3");


I have the error "Paragraph style can not be found" but the style is present in the template doc.
From where this error could come?

Thanks in advance for your return.

elysiumsecurity
 
Posts: 14
Joined: Mon Oct 09, 2017 8:15 am

Wed Oct 11, 2017 9:24 am

Dear elysiumsecurity,

Thanks for your inquiry.
Could you please provide us with the input document for further investigation ?

Many thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Oct 11, 2017 1:08 pm

Hello,

Please find attached file.

Thanks,

elysiumsecurity
 
Posts: 14
Joined: Mon Oct 09, 2017 8:15 am

Thu Oct 12, 2017 2:25 am

Dear elysiumsecurity,

Thanks for sharing.
I checked the document, and found there was not a style named "Titre 3", only found a styleId named "Titre3" . Spire.Doc applies the style by original name or id at present. If you want to use the styleId, please remove the spacing and try again.
Code: Select all
paragraph.ApplyStyle("Titre3");

If I misunderstand, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Oct 13, 2017 10:09 am

Dear elysiumsecurity,

Did you try the solution I mentioned ? Has your issue been resolved ?

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Mon Oct 16, 2017 8:46 am

Hello,

Yes thank you for the solution.

However, can you explain to me, how you find the styleId named "Titre3" in Word?

Thank you,

elysiumsecurity
 
Posts: 14
Joined: Mon Oct 09, 2017 8:15 am

Mon Oct 16, 2017 9:01 am

Dear elysiumsecurity,

Thanks for your feedback.
I use the tool 7-zip to extract the content, then find the xml file named styles.xml(attachment is the extracted file, please unzip it, then find the file, word=> styles.xml). Then search the word "Titre3".
If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Oct 18, 2017 7:12 am

Dear elysiumsecurity,

Greeting from e-iceblue.
How is the issue now ?
Any question, please feel free to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Oct 18, 2017 8:20 am

it's ok, the problem is solve.

Thank you for the help.

elysiumsecurity
 
Posts: 14
Joined: Mon Oct 09, 2017 8:15 am

Wed Oct 18, 2017 8:41 am

Dear elysiumsecurity,

Thanks for your feedback.
Please feel free to contact us if you need any help.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.Doc

cron