How to display pdf & word file
-
I am trying to open MS word file or PDF fie in my project tel me what should i do for this. I have searched on net but still i am facing problem in this code which is, if (this.openFileDialog1.ShowDialog() == DialogResult.Yes) { // set the file name from the open file dialog object fileName = openFileDialog1.FileName; object readOnly = false; object isVisible = true; // Here is the way to handle parameters you don't care about in .NET object missing = System.Reflection.Missing.Value; // Make word visible, so you can see what's happening WordApp.Visible = true; // Open the document that was chosen by the dialog 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); // Activate the document so it shows up in front aDoc.Activate(); // Add the copyright text and a line break WordApp.Selection.TypeText("wFile.doc"); WordApp.Selection.TypeParagraph(); } In Bold code their is error this is not working. WHAT SHOULD I DO ?
-
I am trying to open MS word file or PDF fie in my project tel me what should i do for this. I have searched on net but still i am facing problem in this code which is, if (this.openFileDialog1.ShowDialog() == DialogResult.Yes) { // set the file name from the open file dialog object fileName = openFileDialog1.FileName; object readOnly = false; object isVisible = true; // Here is the way to handle parameters you don't care about in .NET object missing = System.Reflection.Missing.Value; // Make word visible, so you can see what's happening WordApp.Visible = true; // Open the document that was chosen by the dialog 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); // Activate the document so it shows up in front aDoc.Activate(); // Add the copyright text and a line break WordApp.Selection.TypeText("wFile.doc"); WordApp.Selection.TypeParagraph(); } In Bold code their is error this is not working. WHAT SHOULD I DO ?
-
Sajjad Leo wrote:
WHAT SHOULD I DO ?
State the error that you are getting and use the <pre> tag around code when you're posting :)
I are troll :)
This is the error no overload for method 'open' takes '12' arguments
-
This is the error no overload for method 'open' takes '12' arguments
Sajjad Leo wrote:
no overload for method 'open' takes '12' arguments
then thats your problem. Do you not understand that simple message? if your IDE doesnt help with params then search for the function signature on google. you should find that the Open function wants 15 params, 3 more (15 - 12) than you are giving it
Life goes very fast. Tomorrow, today is already yesterday.
-
Sajjad Leo wrote:
no overload for method 'open' takes '12' arguments
then thats your problem. Do you not understand that simple message? if your IDE doesnt help with params then search for the function signature on google. you should find that the Open function wants 15 params, 3 more (15 - 12) than you are giving it
Life goes very fast. Tomorrow, today is already yesterday.
ok i am trying to find more three but do you any idea then tell me well thanx ....
-
ok i am trying to find more three but do you any idea then tell me well thanx ....