How to clear No overload Method Open? [Resolved]

Posted by Gudevg under C# on 5/9/2012 | Points: 10 | Views : 3493 | Status : [Member] | Replies : 7
Hi all,

Presently i am working on MS office tool development i complete the code fully and add the references,

1) Interop.word
2) Word
3) Office references

private void readFileContent(string path)
{
Microsoft.Office.Interop.Word.Application wordApp = new Microsoft.Office.Interop.Word.Application();
object fileName = openFileDialog1.FileName;
object file = path;
object missing = System.Reflection.Missing.Value;

Word.Document doc = wordApp.Documents.Open( ref fileName, ref missing,
ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);
doc.ActiveWindow.Selection.WholeStory();


but still it ends with the error- No overload Method "Open" takes "13" arguments.

Guide me to fix the error.

Thanks and Regards,

Deepakkumar G.


Responses

Posted by: Pervej on: 5/9/2012 [Member] Starter | Points: 50

Up
0
Down

Resolved
Hi below code will helps you to get this thing

http://getproductprice.com/Ads-open-word-document-from-dotnet-in-read-only-mode.aspx

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
Yes, I missed while copying it.

Regards,


Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
I mentioned earlier, i add the Microsoft.Office.Interop.Word Namespace properly. still it ends with error


Regards,


Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
Ok

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
Yes thank you for your response you may delete you ID from forum. I will send my full coding to your mail id. if it possible review it.

Thanks and Regards,

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Gudevg on: 5/9/2012 [Member] Starter | Points: 25

Up
0
Down
@Pervej Munjal thank you guy. I got clear the bug

Regards

Deepakkumar G.

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sabarimahesh on: 5/26/2012 [Member] Bronze | Points: 25

Up
0
Down

object fileName = openFileDialog1.FileName;

       WordApp.Documents.Open(ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing);


In Case of This

You CAN DIRECTLY GIVE

object fileName = @"F:\\DOTNETFUNDA.doc"; 

       WordApp.Documents.Open(ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing,ref missing,ref missing);



ref fileName, ref missing,




Life is a Race
Thanks & Regards
By
Sabari Mahesh P M

Gudevg, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response