【发布时间】:2018-07-21 12:05:46
【问题描述】:
我正在开发文档自动化解决方案,用户可以通过该解决方案将项目从自定义文本列表(任务窗格)拖到 Word 文档中。我想使用 Office.js 创建加载项。
在 VSTO 中,我们正在处理 DragDrop 的按钮按下事件:
if (MouseButtons == MouseButtons.Left)
{
strValue = (sender as Button).Text;
ThisAddIn.objWordApplication.Selection.SetRange(Cursor.Position.X, Cursor.Position.Y);
(sender as Button).DoDragDrop(" ", DragDropEffects.All);
oCC1 = ThisAddIn.objWordApplication.ActiveDocument.ContentControls.Add(Word.WdContentControlType.wdContentControlText);
oCC1.Range.Text = strValue;
}
使用 Office.js,是否可以实现从 html 容器(任务窗格)到 Word 文档的相同操作?
谢谢
【问题讨论】:
标签: ms-word office-js office-addins