<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /> Hi
I’m trying to add header and footer text to word documents. I have followed the sample code provide here
http://www.aspose.com/documentation/.net-components/aspose.words-for-.net-and-java/howto-create-headersfooters-using-documentbuilder.html
The footer is as expected but the header text is not visible? I can remove an existing header but can’t add a new header.
This is the code I am using…
DocumentBuilder builder = new DocumentBuilder(document);
Aspose.Words.PageSetup pageSetup = currentSection.PageSetup;
pageSetup.DifferentFirstPageHeaderFooter = true;
builder.MoveToHeaderFooter(HeaderFooterType.HeaderPrimary);
builder.ParagraphFormat.Alignment = ParagraphAlignment.Center;
builder.Font.Name = "Arial";
builder.Font.Color = System.Drawing.Color.Black;
builder.Font.Size = 8;
// Specify header title for the other page.
builder.Write("Aspose.Words Header/Footer Creation Primer - Title Page.");
builder.InsertField("PAGE", "");
Any help appreciated.
Thanks
Kathy
This message was posted using Page2Forum from How-to: Create Headers/Footers using DocumentBuilder - Aspose.Words for .NET and Java