i use VBA to read data from an excel file and insert it into an word document. Now i am stuck on how i can change the value of an "custom word field". I add a field in the word document in th word menu (menu->info->properties->advanced properties->custom). Here is an Guide how i added the custom fields: click me
my field has the name "w_ean".
I tried something like this, but i always get a runtime error 13..
Function FnOpeneWordDoc()
Dim objWord
Dim objDoc
' Word Objekt erstellen
Set objWord = CreateObject("Word.Application")
' Word Dokument öffnen
Set objDoc = objWord.Documents.Open("myFile.docx")
' Word sichtbar machen!
objWord.Visible = True
objDoc.Fields("w_ean").Result = "123"
End Function