Dynamic creation of Office Open XML documents: updating all fields in open

I programmatically generate an Office Open XML document (Word 2007 format) and would like all fields to be updated when the created document is first opened in Word.

When I explored this a while ago, the only way to do this is to run VB Script when opening a document. But VB Script does not start by default, and for this the user has to allow scripts, which is more difficult than asking the user to do "all-all, F9", and therefore this defeats the goal.

Any suggestion?

Alex

+3
source share
2 answers

. VBA Word - . Word OpenXML .

+2

VB Script.

, .

<w:fldSimple w:instr="TOC" w:dirty="true" />

, ,

<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<w:settings xmlns:w="http://schemas.openxmlformats.org/wordprocessingml/2006/main">
    <w:updateFields w:val="true" />
</w:settings>

, , , : " , . ?"

+7

Source: https://habr.com/ru/post/1702932/


All Articles