我在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;
最好的问候。