2011-10-27 24 views
0

我試圖用MS Word文件的工作,但是當我寫的代碼如下:這對於C#Document對象庫

Document document = new Document("Sample.doc"); 

我收到以下錯誤:

Error: The type or namespace name 'Document' could not be found (are you missing a using directive or an assembly reference?) 

告訴我應該爲這個數據對象包含哪個庫?

回答

1

包括Microsoft.Office.Interop.Word爲您的應用程序和參考,在你的類,寫

using Microsoft.Office.Interop.Word