为什么 MSWord2007 不接受我对 .dotm 文件的更改?
根据 Office .dotm 文件的注释,它们在结构上与 .docx 文件相似(或相同) - 换句话说,是 zip 存档。
如果我提取 .dotm 文件的内容(使用归档工具),然后将生成的文件重新压缩回 .dotm 文件,准确保留结构(文件位置) - MSWord2007 会抱怨新的 .dotm 文件无效。
.dotm 文件需要哪些附加格式(详细信息),而归档工具没有(默认)或无法提供?
According to the notes on office .dotm files, they are similar (or the same) in structure to the .docx files - in other words a zip archive.
If I extract the contents of a .dotm file (using an archiving tool), and then recompress the resulting files back into a .dotm file, preserving the structure (file locations) exactly - MSWord2007 complains that the new .dotm file is invalid.
What additional formatting (in detail) for .dotm files is required that the archiving tool does not (by default) or cannot provide?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
使用名为“Infozip”的工具 - 它由多个可执行文件(zip.exe、unzip.exe 等)组成,以实现可行的解决方案。
[-] 使用 unzip.exe 将 .dotm 文件的内容提取到临时文件夹
[-] 对相关文件进行了必要的更改(在本例中为 CustumUI.xml)
[-] 通过指示 zip.exe“刷新”存档来更新原始存档(.dotm 文件) - 即不重新压缩到新存档,而是仅更新更改的文件。
这似乎保持了非标准存档元数据的完整性,同时更改了存档中所需文件的内容。
MS Word 2007 现在打开启用宏的模板文件并正确应用更改。
Used a tool called 'Infozip' - which consisted of several executables (zip.exe, unzip.exe, etc) to implement a working solution.
[-] Extracted the contents of the .dotm file to a temporary folder using unzip.exe
[-] Made the required changes to relevant files (in this case CustumUI.xml)
[-] Updated the original archive (.dotm file) by instructing zip.exe to 'refresh' the archive - i.e. NOT recompress to a new archive, but update changed files only.
This seemed to keep the non-standard archive metadata intact while changing the contents of the desired file within the archive.
MS Word 2007 now opens the macro-enabled template files and applies the changes correctly.