在visual studio中,我創建了對Aspose程序集的引用,並在我的代碼中使用了Document類。它在設計時看起來很好,但是當我去編譯時,我得到的錯誤'Type Aspose.Words.Document'沒有定義。'如果我做了任何改變項目文件的事情,比如添加或刪除一個引用或添加一個新文件,這些錯誤就會消失......直到我再次嘗試編譯爲止。錯誤'類型Aspose.Words.Document'未定義。'當試圖編譯
有沒有其他人看到這種奇怪的行爲,並知道如何解決它?這是我的代碼,如果它很重要,但它並沒有變得更簡單:
Module Module1
Sub Main()
Dim license As New Aspose.Words.License()
license.SetLicense("Aspose.Words.lic")
Dim files = My.Resources.files.Split()
For Each file In files
If file <> "" Then
Dim changed As Boolean = False
Console.Write("Processing " & file & "...")
Dim doc = New Aspose.Words.Document(file)
If doc.Range.FormFields("CurrDate") IsNot Nothing Then
doc.Range.FormFields("CurrDate").TextInputType = Aspose.Words.Fields.TextFormFieldType.RegularText
doc.Range.FormFields("CurrDate").TextInputFormat = ""
doc.Save(file)
Console.WriteLine("done.")
Else
Console.WriteLine("not applicable.")
End If
End If
Next
Console.Read()
End Sub
End Module
只有一個庫,我不需要導入語句,因爲它們是完全限定的,對嗎? – adam0101 2010-11-11 21:56:32