How to right justify output of this code

I’m adding a footer and inserting text with the following code:

Dim footer As New HeaderFooter(doc, HeaderFooterType.FooterPrimary)
Dim para As New Paragraph(doc)
Dim run As New Run(doc, "[some text]")

I have two questions:

  1. How can I right justify this inside the footer?
  2. Is there anyway to reduce the amount of code above? Seems like too much code just to insert a footer and some text.


Thanks for your request. In your case you should use ParagraphAlignment property, please see the following link for more information:
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.
Please let me know in case of any issues I will be glad to help you.
Best regards,