The problem is following. I have a tool that generates .docm
files. These files contain some macros
. The code of macros has settings information, like URL
s, etc. I want to somehow access from PHP
this macros in order to make changes programmatically. This is especially necessary when the whole application with this document generator moves to another server.
从PHP访问MS Word宏
- 写回答
- 好问题 0 提建议
- 追加酬金
- 关注问题
- 邀请回答
-
1条回答 默认 最新
- douqian1517 2015-06-17 13:01关注
A
.docm
document can be more or less be considered to be a normal.zip
file.You can therefore open your document with some PHP unzipping function/library, thereby gaining access to the included file
word/vbaProject.bin
. You then need find or create a PHP library that can modify thisvbaProject.bin
file.A quick search pointed me to this answer where the documentation for the
vbaProject.bin
file format is linked to: https://stackoverflow.com/a/17538985/1560865Since the file format seems to be quite complex and there will probably be no PHP library available for it, you might want to look for an easier way though....
本回答被题主选为最佳回答 , 对您是否有帮助呢?解决 无用评论 打赏 举报