2016-10-18 39 views
0

我如何可以運行視圖頁面如何的ViewPage獲得Word中編輯任命

var inspector = Globals.ThisAddIn.Application.ActiveInspector(); 
var document = (Word.Document)inspector.WordEditor; 

它做工精細與編輯的看法,但主要的[視圖]頁檢查員爲null,則下面的代碼 enter image description here

回答

0

使用物品檢查器代替ActiveInspector:

var document = item.GetInspector.WordEditor as Word.Document; 
if (document != null) 
{ 
    //code here.... 
}