web development India freelance website designer
This code open word In the background, create a new document and write the text from the RTF
Box In the test.doc file. It also Do the same thing the other way around.(Basically, but it dont see
the return key) This works For txt only!

Dim WordApp As Word.Application
Dim Documents As Object

Private Sub Command1_Click()
Set WordApp = CreateObject("Word.Application")
Set Document = Word.Documents.Add
' Place some text in the doc
Document.Range.InsertBefore RichTextBox1.Text & vbCrLf & vbCrLf
' Save the sheet to C:\test.doc directory
Document.SaveAs "C:\ TEST.DOC"
' Close Word with the Quit method on the Application object
Word.Application.Quit
' Release the object variable
Set WordApp = Nothing
End Sub


Private Sub Command2_Click()
Set WordApp = CreateObject("Word.Application")
Set Document = Word.Documents.Add
Word.Documents.Open "C:\ TEST.DOC"
RichTextBox1.Text = Word.ActiveDocument.Range
'Word.Documents.Open
Word.Application.Quit
' Release the object variable
Set WordApp = Nothing
End Sub


Private Sub Command3_Click()
Unload Me
End Sub
Write txt to doc file.

1651 1652 1653 1654 1655 1656 1657 1658 1659 1660 1661 1662 1663 1664 1665 1666 1667 1668 1669 1670 1671 1672 1673 1674 1675 1676 1677 1678 1679 1680 1681 1682 1683 1684 1685 1686 1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700

Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design