I have Word documents with fields like { DOCVARIABLE "508" }
. Can I use Office.js API to add or set document variables ?
Asked
Active
Viewed 359 times
1

Patrick Beaulieu
- 11
- 1
-
As far as I know, the Office JS API has not facility for working with Word fields, because they aren't supported in Word On-line. There are a couple of requests on UserVoice (in the Office Developer section) for creating fields. FWIW Document `Variables` (and thus the `DocVariable` field) are older technology. For similar functionality you might want to research Content Controls linked to a Custom XML Part. The Office JS APIs support both, I believe. – Cindy Meister Jan 15 '20 at 19:15