Hi all
I am trying to populate a word template document property (the title) from the value held in an excel range. My word template has the appropriate document property set up via the quick parts menu, but I can't seem to find how to write to this property from excel vba.
I've managed to open my template through createobject("Word.Application") but fail on this line (with WDoc) defined as an object
WDoc.BuiltinDocumentProperties(wdPropertyTitle).Value = Dossier.Range("C2"), I get a run time error 5 invalid call procedure.
Could anyone let me know what the code should be?
Thanks
I am trying to populate a word template document property (the title) from the value held in an excel range. My word template has the appropriate document property set up via the quick parts menu, but I can't seem to find how to write to this property from excel vba.
I've managed to open my template through createobject("Word.Application") but fail on this line (with WDoc) defined as an object
WDoc.BuiltinDocumentProperties(wdPropertyTitle).Value = Dossier.Range("C2"), I get a run time error 5 invalid call procedure.
Could anyone let me know what the code should be?
Thanks