How to clear No overload Method Open? [Resolved]

Posted by Gudevg under C# on 5/9/2012 | Points: 10 | Views : 3054 | Status : [Member] | Replies : 11
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: Sakthi.Singaravel on: 5/9/2012 [Member] Silver | Points: 25

Up
0
Down
Hi deepakumar count arguments...

Example
Word.Document aDoc = WordApp.Documents.Open(ref fileName, ref missing, ref readOnly, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref missing, ref isVisible);




Regards,
Singaravel M

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: Sakthi.Singaravel on: 5/9/2012 [Member] Silver | Points: 25

Up
0
Down
okay..

For more information..

http://msdn.microsoft.com/en-us/library/tcyt0y1f(v=vs.80).aspx#Y254

Regards,
Singaravel M

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: Sakthi.Singaravel on: 5/9/2012 [Member] Silver | Points: 25

Up
0
Down
add the Microsoft.Office.Interop.Word only..
its enough..
and import this namespace..

using Microsoft.Office.Interop.Word;


Regards,
Singaravel M

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

Posted by: Sakthi.Singaravel on: 5/9/2012 [Member] Silver | Points: 25

Up
0
Down
i m not use emails...
i spent my time for office work and our dotnetfunda forum only.


Regards,
Singaravel M

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