Click here to Skip to main content
12,394,769 members (65,210 online)
Rate this:
 
Please Sign up or sign in to vote.
See more: C# C#4.0
Error 2 Interop type 'Microsoft.Office.Interop.Word.ApplicationClass' cannot be embedded. Use the applicable interface instead. C:\Projects\EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 100 EmployeSoftwareProject
Error 1 The type 'Microsoft.Office.Interop.Word.ApplicationClass' has no constructors defined C:\Projects\EmployeSoftwareProject\EmployeSoftwareProject\Retrivewordfile.cs 49 66 EmployeSoftwareProject

i have implementing Reading a word document using C# i got above errors any one help what am wrong..
Posted 19-Feb-13 23:39pm
Comments
Garth J Lancaster 20-Feb-13 6:05am
   
it might help if you show some code - or otherwise show us how you're using Microsoft.Office.Interop....
Azziet 20-Feb-13 6:22am
   
refer this link

http://www.mindstick.com/Articles/5cd1b721-9b94-4ea0-bd6e-2bb157401069/
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 5

<a href=""></a>[<a href="" target="_blank"></a>]<
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 6

just add this reference "System.IO.File"
then write
File.ReadAllText(@"Path");
This will read all your text from the document
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

Hi,

this error generally occurs if you are trying to create object of "Microsoft.Office.Interop.Word.ApplicationClass" class. so, rather creating object of ApplicationCLass, create object of "Application", i.e, "Microsoft.Office.Interop.Word.Application".
//Example
Microsoft.Office.Interop.Word.Application Doc = new Microsoft.Office.Interop.Word.Application();
Application Interface[^]
Microsoft.Office.Interop.Word Namespace[^]

hope it helps.
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

About the error type 2.

Please check if the invoked dll property "Embedd Interop" is changed as "false".
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy | Mobile
Web02 | 2.8.160721.1 | Last Updated 28 May 2015
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100