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

Free Support Forum - aspose.com

Insert Right- left -center using aspose.word

I would like to insert left,right and center header to the document.

I have tried implementing this using

            builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

            builder.ParagraphFormat.Alignment = ParagraphAlignment.Right;

            builder.Write("right");

            builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

            builder.ParagraphFormat.Alignment = ParagraphAlignment.Left;

            builder.Write("Left");

            builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);

            builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;

            builder.Write("Center");

But this doesnt work.

I have previously implemented left and right header using the following code.

            builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
            builder.ParagraphFormat.TabStops.Add(475.9, TabAlignment.Right, TabLeader.None);
            builder.Write(strLeftHeader + ControlChar.Tab + "Left header");

But now i would like to insert center header as well
Please give me a solution as soon as possible…


Hi there,

Thanks for your inquiry. Please manually create your expected Word document using Microsoft Word and attach it here for our reference. We will investigate how you want your final Word output be generated like. We will then provide you more information on this along with code.

Hi,


I have attached a sample document which show how left,right,center header has to be show using aspose.write.

In the same way i would like to have left right and center footer to the document

With Regards,
Prithiviraj.M