如何使用当前tab/cursor位置向word文档添加文本内容
How to add text content to a word document using the current tab/cursor location
您好,我正在尝试将内容添加到使用命令打开的 ms word 文件
$word = new COM("word.application") or die("Unable to instanciate Word");
$input ="D:\testword.docx";
$word->Documents->Open($input);
现在我将手动更改打开的文档中的光标位置,我想在该位置添加一些内容。
$word->选择->Typetext("The content to be added into current cursor position");
以上代码会将内容添加到 Doc 文件的开头,但如何将其添加到光标所在的位置。
我找到了解决办法。无论我将光标放在活动 Word 文档中的什么地方,我都可以导出文本。
您好,我正在尝试将内容添加到使用命令打开的 ms word 文件
$word = new COM("word.application") or die("Unable to instanciate Word");
$input ="D:\testword.docx";
$word->Documents->Open($input);
现在我将手动更改打开的文档中的光标位置,我想在该位置添加一些内容。
$word->选择->Typetext("The content to be added into current cursor position");
以上代码会将内容添加到 Doc 文件的开头,但如何将其添加到光标所在的位置。
我找到了解决办法。无论我将光标放在活动 Word 文档中的什么地方,我都可以导出文本。