Microsoft.Office.Core Reference Missing

前端 未结 13 1419
谎友^
谎友^ 2020-12-13 01:11

Using the example provided in codeproject I am struggling to work out where I can find the reference to the library Microsoft.Office.Core.

I am getting the error \"

相关标签:
13条回答
  • 2020-12-13 01:56

    I have the same trouble. I went to Add references, COM tab, an select Microsoft Office 15.0 Objetct Library. Ok, and my problem ends.

    part of my code is:

    EXCEL.Range rango;
                rango = (EXCEL.Range)HojadetrabajoExcel.get_Range("AE13", "AK23");
                rango.Select();
          //      EXCEL.Pictures Lafoto = (EXCEL.Pictures).HojadetrabajoExcel.Pictures(System.Reflection.Missing.Value);
                EXCEL.Pictures Lafoto = HojadetrabajoExcel.Pictures(System.Reflection.Missing.Value);
    
                HojadetrabajoExcel.Shapes.AddPicture(@"D:\GENETICA HUMANA\Reportes\imagenes\" + Variables.nombreimagen,
                    Microsoft.Office.Core.MsoTriState.msoFalse, Microsoft.Office.Core.MsoTriState.msoCTrue,
                    float.Parse(rango.Left.ToString()),float.Parse(rango.Top.ToString()), float.Parse(rango.Width.ToString()),
                    float.Parse(rango.Height.ToString()));
    
    0 讨论(0)
  • 2020-12-13 01:58

    In case you are using Visual Studio 2012, for this to work and in order to make reference to Microsoft Office Core, you have to make the reference through Visual Studio by clicking on the top menu's Project, Add Reference, Extensions button and checking office which is now (14.0).

    0 讨论(0)
  • 2020-12-13 02:00

    Open the properties of the solution and click publish. Then, reclick application files. Change prerequisite to include.

    0 讨论(0)
  • 2020-12-13 02:01

    Have you actually gone to your references and added a .NET reference to the 'Microsoft.Office.Core' library? If you downloaded the example application, the answer would be yes. If that is the case, follow the advice in the article:

    If your system does not have Microsoft Office Outlook 2003 you may have to change the References used by the "OutlookConnector" project. That is to say, if you received a build error described as "The type of namespace name 'Outlook' could not be found", you probably don't have Office 2003. Simply expand the project references, remove the afflicted items, and add the COM Library appropriate for your system. If someone has a dynamic way to handle this, I'd be curious to see you've done.

    That should solve your problem. If not, let us know.

    0 讨论(0)
  • 2020-12-13 02:02

    After installing the Office PIA (primary interop assemblies), add a reference to your project -> its on the .NET tab - component name "Office"

    0 讨论(0)
  • 2020-12-13 02:05

    Now there is a nuget package for that.

    https://www.nuget.org/packages/NetOffice.Core.Net40/

    First I didn't find office in COM, so tried this nuget and it worked!

    0 讨论(0)
提交回复
热议问题