Home > Software design >  How can I paste the table on my first page/section?
How can I paste the table on my first page/section?

Time:06-08

i have this code


    word_fichier_template.Tables(1).Range.Copy
    
    'Pasting the table in every section of my document
    With word_fichier.Sections(1).Footers(wdHeaderFooterPrimary).Range
        .Collapse wdCollapseStart
        .Paste
    End With

    'Working fine, pasting the table in the second section
    word_fichier_template.Tables(2).Range.Copy
    With word_fichier.Sections(2).Headers(wdHeaderFooterPrimary).Range
        .Collapse wdCollapseStart
        .Paste
    End With

I want to copy/paste a table in headers and footers in a .docx, i dont understand the thing i put in comment in my code. I also tried Headers(wdHeaderFooterFirstPage).Range to put the table just on the first page/section but doesnt work. Here is a sample of my word. enter image description here enter image description here

CodePudding user response:

Your footers are linked - see the tag at the top right of the footer - "Identique au précédente". Turn that setting off and the footers in Section 2 will not be the same as Section 1.

enter image description here

To get a different footer on the first page of a section you need to change the setting in Page Layout.

enter image description here

  • Related