获取错误库未注册 [英] getting Error Library not registered
问题描述
我想在我的应用程序中保存.rtf文件,我必须转换为pdf格式的文件
文件保存成功,然后我尝试打开文件n转换为pdf格式
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application ();
object oMissing = System.Reflection.Missing.Value;
FileInfo wordFile = new FileInfo(System.Web.Hosting.HostingEnvironment.MapPath( 〜/ RateAnalysisFileStorage /)+ fileName);
对象 filename =(对象)wordFile.FullName;
文件doc = word.Documents.Open(ref filename,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref o Missing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing);
doc.Activate();
object outputFileName = wordFile.FullName.Replace( 。doc, 。pdf);
object fileFormat = WdSaveFormat.wdFormatPDF;
doc.SaveAs(ref outputFileName,
ref fileFormat,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing,
ref oMissing ,ref oMissing,ref oMissing,ref oMissing,
ref oMissing,ref oMissing,ref oMissing,ref oMissing);
它给了我一些错误
无法将Microsoft.Office.Interop.Word.ApplicationClass类型的COM对象强制转换为接口类型Microsoft.Office.Interop.Word._Application。此操作失败,因为由于以下错误,对IID为{00020970-0000-0000-C000-000000000046}的接口的COM组件的QueryInterface调用失败:库未注册。 (HRESULT例外:0x8002801D(TYPE_E_LIBNOTREGISTERED))。
谢谢
Ankita Mali
我也收到了同样的错误并重新安装了组件(删除整个组件并重新安装)错误自动排序
点击此链接,这可以帮助您
http://www.sautinsoft的.com /产品/ PDF的变态/
I am trying to save .rtf file in my application,and i have to convert the file in pdf format
File is saving successfully,then i try to open file n convert in pdf format
Microsoft.Office.Interop.Word.Application word = new Microsoft.Office.Interop.Word.Application();
object oMissing = System.Reflection.Missing.Value;
FileInfo wordFile = new FileInfo(System.Web.Hosting.HostingEnvironment.MapPath("~/RateAnalysisFileStorage/") + fileName);
Object filename = (Object)wordFile.FullName;
Document doc = word.Documents.Open(ref filename, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing);
doc.Activate();
object outputFileName = wordFile.FullName.Replace(".doc", ".pdf");
object fileFormat = WdSaveFormat.wdFormatPDF;
doc.SaveAs(ref outputFileName,
ref fileFormat, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing);
It is giving me follwoing error
Unable to cast COM object of type 'Microsoft.Office.Interop.Word.ApplicationClass' to interface type 'Microsoft.Office.Interop.Word._Application'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{00020970-0000-0000-C000-000000000046}' failed due to the following error: Library not registered. (Exception from HRESULT: 0x8002801D (TYPE_E_LIBNOTREGISTERED)).
Thank you
Ankita Mali
i have also recieved the same error and by reinstalling the component (removing the whole component and installing it back) the error was automatically being sort out
Follow this link, this may help you
http://www.sautinsoft.com/products/pdf-metamorphosis/
这篇关于获取错误库未注册的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!