word 2010 interop:编辑word文档标题

时间:2011-07-13 15:03:20

标签: interop ms-word dsoframer

我在winforms应用程序中使用word 2010和DSOFramer控件嵌入word文档,我必须进入标题编辑模式我使用下面的代码:

if (wordDocument.ActiveWindow.View.SplitSpecial != WdSpecialPane.wdPaneNone)
    wordDocument.ActiveWindow.Panes[2].Close();
  if (wordDocument.ActiveWindow.ActivePane.View.Type == WdViewType.wdNormalView ||
    wordDocument.ActiveWindow.ActivePane.View.Type == WdViewType.wdOutlineView)
    wordDocument.ActiveWindow.ActivePane.View.Type = WdViewType.wdPrintView;
  wordDocument.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader;

但执行此行时应用程序无响应:

wordDocument.ActiveWindow.ActivePane.View.SeekView = WdSeekView.wdSeekCurrentPageHeader;

最好的问候。

1 个答案:

答案 0 :(得分:1)

可在此处找到解决方案Word 2010 header edition