Dim WordDoc As New Microsoft.Office.Interop.Word.Application
WordDoc .Documents.Open("d:\Hello.docx") '把你想複製的檔案路踁放在這裡
WordDoc .Selection.WholeStory()
WordDoc .Selection.Copy()
RichTextBox1.Paste()
WordDoc .Quit()
vb.net但提示我,并没有WholeStory
3 个解决方案
#1
加上一点延迟看看是否可以贴上,看下剪贴板有没有内容。
#2
WordDoc .Documents.Open("d:\Hello.docx")
WordDoc是wordapplication,你还缺一个WordDocument对象。帮你稍微改一下
Dim WordDoc As Word.Document, WordApp As Microsoft.Office.Interop.Word.Application
WordDoc = WordApp.Documents.Open("d:\Hello.docx") '把你想複製的檔案路踁放在這裡
WordDoc.Selection.WholeStory()
WordDoc.Selection.Copy()
RichTextBox1.Paste()
WordDoc.Quit()
#3
操作结束以后的代码忘改了
相应地改成
相应地改成
WordDoc.Close()
WordApp.Quit()
#1
加上一点延迟看看是否可以贴上,看下剪贴板有没有内容。
#2
WordDoc .Documents.Open("d:\Hello.docx")
WordDoc是wordapplication,你还缺一个WordDocument对象。帮你稍微改一下
Dim WordDoc As Word.Document, WordApp As Microsoft.Office.Interop.Word.Application
WordDoc = WordApp.Documents.Open("d:\Hello.docx") '把你想複製的檔案路踁放在這裡
WordDoc.Selection.WholeStory()
WordDoc.Selection.Copy()
RichTextBox1.Paste()
WordDoc.Quit()
#3
操作结束以后的代码忘改了
相应地改成
相应地改成
WordDoc.Close()
WordApp.Quit()