none
Manage section headers and footers using Open XML RRS feed

  • Question

  • Hi

    In my conversion project from Word interop webservice to Open XML webservice I have one more task to solve. :-)

    In the interop solution I try to manage the section settings for the header and footer after another document content is inserted
    into the document.

    The old code looks like this:

    If wDoc.Sections.Count > 1 Then
        Dim wSect As Word.Section
        For Each wSect In wDoc.Sections
            If wSect.Index = 1 Then
                wSect.PageSetup.DifferentFirstPageHeaderFooter = True
                wSect.Headers(Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage).LinkToPrevious = False
                wSect.Footers(Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage).LinkToPrevious = False
            Else
                wSect.PageSetup.DifferentFirstPageHeaderFooter = False
                wSect.Headers(Word.WdHeaderFooterIndex.wdHeaderFooterPrimary).LinkToPrevious = True
                wSect.Footers(Word.WdHeaderFooterIndex.wdHeaderFooterPrimary).LinkToPrevious = True
            End If
        Next
    End If
    
    
    

    How can this be accomplished using Open XML?

    Thanks in advance

     


    Best Regards Peter Karlström Midrange AB, Sweden
    Friday, November 25, 2011 9:20 AM

Answers

  • Hi

    Project is put on ice by customer, since there was too many tasks in order to replace the current working application with an Open XML-one.


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 21, 2012 5:25 PM

All replies

  • Hi Peter,

    Thank you for posting.

    I will try to help you involve other engineers to help you. There might be some delay about the response. Appreciate your patience.

    Best Regards,


    Bruce Song [MSFT]
    MSDN Community Support | Feedback to us
    Monday, November 28, 2011 10:08 AM
  • Hello Peter,

    You can use the SectionProperties object and HeaderReference and FooterReference classes to set various values.

    I would suggest to create a document using your automation code and then open it using Open XML SDK Productivity Tool to reflect the code. Check the code which mentions about the SectionProperties, HeaderReference and FooterReference.

    I hope this will help you.

    Thanks

    Sreerenj Nair

    Tuesday, December 20, 2011 2:06 AM
  • Hi Sreerenj

    I will look into this after the holidays, and will get back to the forum with the results.


    Best Regards Peter Karlström Midrange AB, Sweden
    Tuesday, December 20, 2011 12:48 PM
  • Hi

    Project is put on ice by customer, since there was too many tasks in order to replace the current working application with an Open XML-one.


    Best Regards Peter Karlström Midrange AB, Sweden

    Tuesday, February 21, 2012 5:25 PM