使用VSTO向Word文档中添加数学公式(2)
来源:未知 责任编辑:责任编辑 发表时间:2013-12-22 14:55 点击:次
Word.OMathFunction wdFunction = wdApplication.Selection
.OMaths[1].Functions.Add(wdApplication.Selection.Range,
Word.WdOMathFunctionType.wdOMathFunctionNary);
Word.OMathNary wdNary = wdFunction.Nary;
wdNary.Char = 8721;
wdNary.Grow = false;
wdNary.SubSupLim = false;
wdNary.HideSub = false;
wdNary.HideSup = false;
//以下代码将数值填写入公式
Word.Selection wdSelection = wdApplication.Selection;
object unit = Word.WdUnits.wdCharacter;
object lu = Word.WdUnits.wdLine;
object count = 1;
object tcount = 3;
wdSelection.MoveLeft(ref unit, ref count);
wdSelection.TypeText("11");
wdSelection.MoveLeft(ref unit, ref tcount);
wdSelection.TypeText("12");
wdSelection.MoveDown(ref lu, ref count);
wdSelection.TypeText("13");
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>