Perl可以使用MSOFFICE :: WORD :: HTML :: WRITER编辑现有Word文档吗?

发布于 2025-02-02 22:24:26 字数 497 浏览 2 评论 0原文

我有一个Word文档,想添加一个图像徽标,我从CPAN msoffice :: Word :: HTML :: Writer找到了此模块。 可以操纵新的Word文档,例如写图像

$doc->write("<img src='files/my_image.gif'>");

我的问题我如何使用此模块msoffice :: Word :: HTML :: Writer已经存在的Word文档,例如来自 new method> new方法似乎创建一个新的Word文档,但是没有选择已创建的文档。

I have a Word document and want to add to it an image logo, I found this module from CPAN MsOffice::Word::HTML::Writer
which can manipulate new word documents like for example writing image

$doc->write("<img src='files/my_image.gif'>");

My question how I can open with this module MsOffice::Word::HTML::Writer an already existed word document, as from the new method seems create a new Word document, but there are no option to open already created document.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

深陷 2025-02-09 22:24:26

文档中的示例首先是图像,然后引用它:

$doc->attach("my_image.gif", $path_to_my_image);
$doc->write("<img src='files/my_image.gif'>");

但是模块文档说它是为了制作Word Docs,而不是编辑它们:

当前的模块是一种编程生成针对Microsoft Word(Msword)的文档的方法。它不需要安装MSWORD,甚至不需要Win32机器(这就是为什么模块不在Win32名称空间中的原因)。

The examples in the docs show that you have to attach an image first, then reference it:

$doc->attach("my_image.gif", $path_to_my_image);
$doc->write("<img src='files/my_image.gif'>");

But the module docs say that it's for making Word docs, not editing them:

The present module is one way to programatically generate documents targeted for Microsoft Word (MsWord). It doesn't need MsWord to be installed, and doesn't even require a Win32 machine (which is why the module is not in the Win32 namespace).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文