Word document viewing in RichTextBox control

  • Thread starter Thread starter sss024
  • Start date Start date
sss024 said:
Word document viewing in RichTextBox control

No. RichTextBox does not support viewing DOC files. (If this is what you
want to hear...)
 
Try following code:
Public Sub InsertWordDocument(ByVal fullFileName As Object Byval rtb as
RichTextBox)
Dim wd As New Word.Application

With wd
.Documents.Open(fullFileName)
.Selection.WholeStory()
.Selection.Copy()

rtb.Paste

.Quit()
End With
wd = Nothing
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top