How to copy/paste a table in footer word vba

julien1h

I have this code :

    Dim word_fichier, word_fichier_sensiblité As Document
    Dim fichier As String
    Dim fichier_sensibilite As String
    Dim word_app As Word.Application

'On récupère le template
    fichier = ActiveWorkbook.Path & "\" & "fsm_template_balises_test.docx"
    fichier_sensibilite = ActiveWorkbook.Path & "\" & "templates_sensibilité.docx"
    
'Ouverture de word
    Set word_app = CreateObject("Word.Application")
    With word_app
        .Visible = True
        .WindowState = 1
    End With
    
'Définition de l'objet fichier word
    Set word_fichier = word_app.Documents.Open(fichier)
    Set word_fichier_sensiblité = word_app.Documents.Open(fichier_sensibilite)

'Copie du tableau
    word_fichier_sensiblité.Tables(1).Range.Copy

    
'Collage du tableau
    With word_fichier.Sections(1).Footers(wdHeaderFooterPrimary)
        .Range.Paste
    End With

I have an existing footer in my word_fichier and i want to paste a table from the word_fichier_sensiblité. For now my table is erasing my existing footer, idk how to paste this table at the beginning of my footer. Any advise ?

Thanks

Timothy Rylatt
With word_fichier.Sections(1).Footers(wdHeaderFooterPrimary).Range
    .Collapse wdCollapseStart
    .Paste
End With

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Adding a table in a word footer using excel VBA

Word VBA - CopyPaste Image-header in a new Document

How can I apply a style to the footer in Word 2010 with VBA?

Word footer image alignment in VBA

vba Word how to get sentences in a table

VBA word, Add Pagenumber to text of footer

vba read the content of a footer out of a word document

Create Footer in Word Doc with VBA and Right Align

Editing PowerPoint presentation footer from Word VBA

VBA find and replace in a word doc's footer

Set line spacing of footer in word using VBA

VBA (Word) - Footer shapes collection contains both footer and header shapes

replace text in multiple footer and/or primary footer word vba

How can I insert page numbering field logic into a footer on my Word template using VBA?

VBA excel how to get table number in for each word table

How can get a Range of Cell of Table in a Shape (VBA Word)?

How to use VBA to format table column font in Word?

How to use VBA to format a table at endnotes in Microsoft word?

How to select every table in a Microsoft Word document using VBA Macro

How to automatically split cells in word table using VBA

How to update a Table of Tables with macro vba-Word?

How to Export merged table from word to Excel using vba

How to set cursor after a table in word document using VBA

How to determine the cell size of a nested table cell in VBA for Microsoft Word?

how to change the table footer color

How to create a table footer in pdfmake

How to change the font of the first word in the footer of a flextable?

Inserting Header/Footer into newly created word document from Excel VBA

Word VBA Getting page number of a specific footer in section