How do I get a C# file run from the command line to reference the Microsoft.Office namespace?
-
I am fairly new to C#, and primarily picked up the language to be able to write a solution which opens and reads Microsoft Office file types using the Microsoft.Office.Interop namespace. At this point, I have written the solution, and when I debug a C# script using Microsoft Visual C# 2010 Express, it compiles and runs fine, successfully extracting the text from all Office file types. However, I have run into the persistent problem that when I try to compile the C# file from the command line, I get the error that "the type or namespace 'Office' does not exist in the namespace 'Microsoft'". Most of the advice I've found on fixing this relates to including a reference specifying the path of the Microsoft.Office.Interop.dll file when I run the command to compile, but I can't seem to find it anywhere in the suggested locations to check (such as C:\Window\Micrsoft.NET\assembly). If anyone has an idea of where I can find the dll file, or whether there is something else I need to do, that would be much appreciated.
-
Answer:
In your solution, go to project right click menu, choose add references and add Microsoft.Office DLL.
Kanwaljit Singh at Quora Visit the source
Related Q & A:
- How do I get the APK file for an Android app?Best solution by Yahoo! Answers
- In Visual Studio 2012 or 2013, how can I register a DLL file on Windows 7 64-bit computer using a Custom Action command?Best solution by Stack Overflow
- How can I get a line cook job at Olive Garden?Best solution by Yahoo! Answers
- How do I get a job with a cruise line?Best solution by Yahoo! Answers
- How do I get a video file off a sony video camera disk?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.