[英]word automation problem
我正在嘗試打開Word文檔進行操作。 但是在“ wordApp.Selection”下面的代碼中始終為null
object missing = System.Reflection.Missing.Value;
Word._Application wordApp = new Word.Application();
Word._Document aDoc =wordApp.Documents.Open(ref fPath1, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible, ref missing, ref missing, ref missing, ref missing);
Word.Selection selection = wordApp.Selection
關於我在這里缺少什么的任何想法。 為什么將wordApp.Selection設置為null。
謝謝。
我相信您必須先設置選擇,然后才能具有值-在Word中打開文檔時,它不會自動選擇整個文檔,您必須以編程方式在選擇具有值之前進行選擇。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.