c#   判断word文档中是否含有页眉

解决方案 »

  1.   

    tring header = wordApp.ActiveDocument.Sections[1].Headers[MSWord.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text;
      Console.WriteLine("得到页眉为:" + header);
      

  2.   

    string header = wordApp.ActiveDocument.Sections[1].Headers[MSWord.WdHeaderFooterIndex.wdHeaderFooterPrimary].Range.Text;
      Console.WriteLine("得到页眉为:" + header);