i found something to write text from a textbox to a textfield in a Word doc , but it is not working.
The field i called Text1
It opens the Word doc but that it , what am i doing wrong ?
Or maybey a link to what is working .
The field i called Text1
It opens the Word doc but that it , what am i doing wrong ?
Or maybey a link to what is working .
Code:
Dim MyApp1 As Object
Dim MyDoc1 As Object
MyApp1 = CreateObject("Word.Application")
MyDoc1 = MyApp1.Documents.Open("C:\test" & "\test.docx")
MyDoc1.Variables("Text1").Value = TextBox1.Text
MyDoc1.Fields.Update()
MyDoc1.Fields.Unlink()
MyApp1.Visible = True