Select All in Winword

Oct 17 2007 7:49 AM
Hi all, I am using this code, to open a word document using Latebinding.Can any one help to copy the contents of the opened document to clipboard. [code] private void button2_Click(object sender, EventArgs e) { object WordApp; object WordDoc; object Doc; ArrayList nFile=new ArrayList(); Object[] objFalse = new Object[1]; objFalse[0] = true; object[] nfilename=new object[1]; nfilename[0]= @"c:\abe.DOC"; Type objClassType = Type.GetTypeFromProgID("Word.Application"); WordApp = Activator.CreateInstance(objClassType); objClassType.InvokeMember("Visible", System.Reflection.BindingFlags.SetProperty, null, WordApp, objFalse); WordDoc = WordApp.GetType().InvokeMember("Documents",System.Reflection.BindingFlags.GetProperty, null, WordApp, null); Doc = WordDoc.GetType().InvokeMember("Open", System.Reflection.BindingFlags.InvokeMethod, null, WordDoc, nfilename); Object WordView = WordApp.GetType().InvokeMember("Quit", System.Reflection.BindingFlags.InvokeMethod | System.Reflection.BindingFlags.Public, null, WordApp, null); } [/code]