2011-07-13 308 views
0

我現在用2010字和DSOFramer控制在WinForms應用程序嵌入Word文檔,我要進入頁眉編輯模式我使用下面的代碼:Word 2010中的互操作:編輯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;

此致敬禮。

回答