Hi,
I’ve got a style in a document for which I need to modify the paragraph settings. Here I need to set the property “paragraph control” (which is located in Word 2010 on the page “Line- and Pagecontrol”, below “pagination”)*, but I can’t find a proper method for doing so.
How can I change the property?
Best regards,
Mathias Harbeck
*: all titles are translated from my localized version of Word - might differ from the original titles in the english version…
Hi
Thanks for your inquiry. I suppose, you mean “Window/Orphan control”. You can set this option in ParagraphFormat. Please see the following link for more information:
https://reference.aspose.com/words/java/com.aspose.words/paragraphformat/#getWidowControl
Please feel free to ask in case of any issues, I will be glad to help you.
Best regards,
Hi Mathias,
Thanks for your inquiry.
Could you please attach your template here for testing and we will provide you with some futher feedback.
Thanks,
Hi,
it isn’t the widow control. I’ll attach the template (the control/property in question is located in the “normal” style (“Standard” in my localization)).
Best regards,
Mathias Harbeck
Hi Mathias,
Thank you for additional information. May I ask you to attach a screenshot where you set this option in MS Word? This will help me to understand what option you are looking for.
Best regards,
Hi Alexey,
here you are. It is the first option in the dialog (“Absatzkontrolle”).
Best regards,
Mathias Harbeck
Hi Mathias,
Thank you for additional information. Actually, it seems I was right, what you are looking for is called “Window/Orphan control” in the original English version of MS Word. If you need to set this option for “Standard” style in your document (which I suppose is “Normal” style in English version), you can use code like the following:
// Open document.
Document doc = new Document("C:\\Temp\\template.rtf");
// Get style.
Style style = doc.getStyles().getByStyleIdentifier(StyleIdentifier.NORMAL);
// Set Window/Orphan control.
style.getParagraphFormat().setWidowControl(true);
// Save the result.
doc.save("C:\\Temp\\out.doc");
Hope this helps.
Best regards,
Hi Alexey,
thank you for your response. I tried it, but with the following code the option is not set:
Document doc = new Document();
DocumentBuilder builder = new DocumentBuilder(doc);
Style style = doc.getStyles().getByStyleIdentifier(StyleIdentifier.NORMAL);
style.getParagraphFormat().setWidowControl(true);
doc.save("P:\\temp\\test.rtf", SaveFormat.RTF);
Best regards,
Mathias Harbeck
Hi
Thank you for additional information. For some reason this option does not work for styles in RTF. If save the output document to DOC all works fine. I logged this problem to our defect database, I will let you know once it is resolved.
Best regards,
The issues you have found earlier (filed as WORDSNET-4114) have been fixed in this .NET update and this Java update.
This message was posted using Notification2Forum from Downloads module by aspose.notifier.