Insert footer into HTMLtoWML converted document.

Home Forums Open-Xml-PowerTools Insert footer into HTMLtoWML converted document.

This topic contains 1 reply, has 2 voices, and was last updated by  Eric White 8 years, 2 months ago.

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #3573

    Alex
    Participant

    Hello!

    I have a document I converted from HTML and I would like to insert a footer. I have the following code to generate the footer:

     private static Footer GeneratePageFooterPart()
            {
                var element =
                    new Footer(
                        new Paragraph(
                            new ParagraphProperties(
                                new ParagraphStyleId() { Val = "Footer" }),
                            new Run(
                                new Text("Some footer text"))
                        ));
    
                return element;
            }

    and the following to append it to the document:

    wmlDocument.MainDocumentPart.Add(GeneratePageFooterPart());

    Though it does not appear to be doing much. I haven’t found any examples of appending a footer to a converted file. Is there some html element that will be converted into a footer I could use or is there some other way?

    Thanks!

    #3686

    Eric White
    Keymaster

    Hi,

    Sorry for the slow response. Have been on vacation.

    With regards to footers and headers, there is some good background information that you should know. Take a look at screen-cast #8 in the following series:

    Introduction to WordprocessingML

    It is fairly complex to create new headers / footers in a document. You have to update the section properties as appropriate, and then navigate to the footer part. You will then find the relevant markup in the footer part.

    Cheers!

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.