I’m adding a footer and inserting text with the following code:
Dim footer As New HeaderFooter(doc, HeaderFooterType.FooterPrimary)
doc.FirstSection.HeadersFooters.Add(footer)
Dim para As New Paragraph(doc)
footer.Paragraphs.Add(para)
Dim run As New Run(doc, "[some text]")
para.Runs.Add(run)
I have two questions:
How can I right justify this inside the footer?
Is there anyway to reduce the amount of code above? Seems like too much code just to insert a footer and some text.
Hi
Thanks for your request. In your case you should use ParagraphAlignment property, please see the following link for more information: https://reference.aspose.com/words/net/aspose.words/paragraphalignment/
Regarding the code, you should note that MS Word document consists of Sections, each Section can have three types of Headers/Footers – First Page, Primary and Even Pages. Please see the following link to learn more about Aspose.Words Document Object Model (DOM) and its relationships. https://docs.aspose.com/words/net/aspose-words-document-object-model/
Please let me know in case of any issues I will be glad to help you.
Best regards,