Dim w As Microsoft.Office.Interop.Word.Document System.Web.UI.Page.AddedControl(w, 4)
vs2005 vb.net 2.0 运行以下代码出错该如何解决:
Dim w As Microsoft.Office.Interop.Word.Document = New Microsoft.Office.Interop.Word.Document
Me.AddedControl(w, 4)
出错信息:无法将类型为“Microsoft.Office.Interop.Word.DocumentClass”的 COM 对象强制转换为类类型“System.Web.UI.Control”。表示 COM 组件的类型实例不能强制转换为不表示 COM 组件的类型;不过,只要基础 COM 组件支持对接口 IID 的 QueryInterface 调用,就能将这些实例强制转换为接口。
其中运行环境 vb.net 2.0 web项目