c# - Can't use Microsoft.Office.Core - no reference for version 12 -
i'm trying use powerpoint interop addin c# winform program. part seems ok, namespace microsoft.office.core (needed msotristate) giving me problems.
i have looked around internet on this, , consensus add reference com tab microsoft office 12 object library. unfortunately, have version 15, , program isn't accepting (errors below). have using reference set ok.
is way around install office 2007? or there way force program accept version 15? i'm on vs 2010.
errors: "the type "microsoft.office.core.msotristate defined in assembly not referenced. must add reference assembly 'office, version 12.0.0.0, culture = neutral, piblic key tokem = 71e9bce111e9429c' "cannot convert 'microsoft.office.core.msotristate [xxx.netframework,version=v4.0,profile=client.assemblyattributes.cs]' 'microsoft.office.core.msotristate' *projectfilepath*
code:
using core = microsoft.office.core; using powerpoint = microsoft.office.interop.powerpoint; powerpoint.presentation file; int slideindex = 0; public powerpointform(string path) { initializecomponent(); var app = new powerpoint.application(); var pres = app.presentations; file = pres.open(path, core.msotristate.msotrue, core.msotristate.msotrue, core.msotristate.msofalse); }
etc
you can install 2007 microsoft office system update: redistributable primary interop assemblies , add reference installed pias assemblies.
Comments
Post a Comment