Easy way to populate MS word form using Excel table data.
main code :
Option Explicit
Const FilePath As String = "C:\Users\Acer-PC\Desktop\AUTOEXPORT\"
Dim wd As New Word.Application
Sub ExportButton()
Dim doc As Word.Document
wd.Visible = True
Dim Name As String
Dim Address As String
Name = ThisWorkbook.Sheets(1).Range("D5").Value 'value from sheet1
Address = ThisWorkbook.Sheets(1).Range("D6").Value
Set doc = wd.Documents.Open(FilePath & "output.docx")
Copy2word "NameField", Name
Copy2word "AddressField", Address
doc.Close
wd.Quit
'MsgBox "Created files in " & FilePath & "!"
End Sub
Sub Copy2word(BookMarkName As String, Text2Type As String)
'copy each cell to relevant Word bookmark
wd.Selection.GoTo What:=wdGoToBookmark, Name:=BookMarkName
wd.Selection.TypeText Text2Type
End Sub