douyun3799 2015-06-17 10:28
浏览 57
已采纳

从PHP访问MS Word宏

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 URLs, 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.

  • 写回答

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 this vbaProject.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/1560865

    Since 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....

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 Stata 面板数据模型选择
  • ¥20 idea运行测试代码报错问题
  • ¥15 网络监控:网络故障告警通知
  • ¥15 django项目运行报编码错误
  • ¥15 请问这个是什么意思?
  • ¥15 STM32驱动继电器
  • ¥15 Windows server update services
  • ¥15 关于#c语言#的问题:我现在在做一个墨水屏设计,2.9英寸的小屏怎么换4.2英寸大屏
  • ¥15 模糊pid与pid仿真结果几乎一样
  • ¥15 java的GUI的运用