Using MS Office and PowerPoint, msoTriState exists in both error

  • Thread starter Thread starter Steve Ricketts
  • Start date Start date
S

Steve Ricketts

I'm trying to read a PowerPoint 2007 file in a C# .ashx and have included:

using core = Microsoft.Office.Core;
using PowerPoint = Microsoft.Office.Interop.PowerPoint;
using System.Runtime.InteropServices;

The problem is an error on the following line:
pptPres = pptApp.Presentations.Open(fileName, MsoTriState.msoTrue,
MsoTriState.msoFalse, MsoTriState.msoFalse);

At first I didn't have the Microsoft.Office.Core and it gave me an error
that said I must include the Office 12 library. So I included the com
object and now I'm getting the error that says
Microsoft.Office.Core.msoTriState exists in both the office.dll and the
Interop.Microsoft.Office.core.dll. I've tried taking out
Microsoft.Office.Core and finding the definition of MsoTriState in
Interop.PowerPoint but I can't find it anywhere there so I can't figure out
why I'm coming up with the "both" error.

What makes this even stranger is the same code works ok on a XP and Vista
system. The problem occurs when I put it on my 2008 Server.

I'm new to C# so any direction would be greatly appreciated,

Steve
 
Thanks for the quick reply...

I took out all the "using" statements and used:

Microsoft.Office.Core.MsoTriState.True and it still says MsoTriState is used
in both .dll's.

In VS 2008 references I have both:

Microsoft.Office.Core
Microsoft.Office.Interop.PowerPoint

However...

I thought I'd check to see if there were any other messages and there was a
warning that I didn't pay alot of attention to. It said something about
"custom wrappers" existing and they were installed after the installation of
VS2008 or something like that. I'm really sorry I didn't pay more
attention. Anyway, it asked if I'd like to replace "whatever" with the
latest custom wrappers and I said ok. When I did that, the program built
without errors. Now I'm really lost! ;-)

Do you have any idea what that was all about?

Thanks and again... sorry for being stupid!

Steve
 
Back
Top