简体   繁体   English

在VBA中编辑MS Word .docx文件

[英]Edit MS Word .docx file in VBA

Unzipping docx file (renamed to *.zip) I'v got several xml files. 解压缩docx文件(重命名为* .zip)我有几个xml文件。

Is there any way to add some sort of data (text) to this xml files using vba? 有什么方法可以使用vba向此xml文件添加某种数据(文本)?

I need to place there a "hidden text" and when it need's, retrieve it. 我需要在此处放置“隐藏文本”,并在需要时将其检索。

Update 1 更新1

For example: in excel I have hidden sheets which store data received from server, it's Jsaon text ("hidden text"). 例如:在excel中,我有隐藏的工作表,用于存储从服务器接收的数据,它是Jsaon文本(“隐藏的文本”)。 I need something similar in Word, but not in active document. 我在Word中需要类似的内容,但在活动文档中则不需要。 I know I can use DocVariable for this, but maybe there is another way. 我知道我可以为此使用DocVariable,但是也许还有另一种方法。

Update 2 更新2

Question resolved, I decided to use DocVariable. 问题解决后,我决定使用DocVariable。 Thanks for help. 感谢帮助。

Why would you go to such lengths? 你为什么要那么长? Why can't the following work for you? 为什么以下内容无法为您服务?

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM