ASPNET调用WORD自动生成的问题
一个奇怪的问题,在WORD自动生成中,我要合并某一列中的几行,因此有以下代码。
MyInsertTable.Cell(33, 1).Select();
object MoveUnit = Microsoft.Office.Interop.Word.WdUnits.wdLine;
object MoveCount = 4;
object MoveExtend = Microsoft.Office.Interop.Word.WdMovementType.wdExtend;
appWord.Selection.MoveDown(ref MoveUnit, ref MoveCount, ref MoveExtend);
appWord.Selection.Cells.Merge();
我在WIN 7的系统上测试没有任何问题,但是发布到服务器windows server 2003上后,提示:
appWord.Selection.Cells.Merge();出错
异常详细信息: System.Runtime.InteropServices.COMException: 此命令无效。
[COMException (0x800a11fd): 此命令无效。]
Microsoft.Office.Interop.Word.Cells.Merge() +0
真是百思不得其解!