Microsoft.Office.Interop.Word problem
Hi,
I'm getting the error at the doc.close in the last argument; type mismatch error
using object 11 com addin; for which the doc.close takes 3 arguments.
thx
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new ApplicationClass();
object file = textBox1.Text;
object nullobj = System.Reflection.Missing.Value;
Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
doc.ActiveWindow.Selection.WholeStory();
doc.ActiveWindow.Selection.Copy();
IDataObject data = Clipboard.GetDataObject();
richTextBox1.Text = data.GetData(DataFormats.Text).ToString();
doc.Close(ref file, ref nullobj,ref nullobj);
gallian99
Junior Poster in Training
77 posts since Jan 2009
Reputation Points: 10
Solved Threads: 0
Ramy Mahrous
Postaholic
2,196 posts since Aug 2006
Reputation Points: 480
Solved Threads: 276