Monday, March 28, 2011

How to load rich text file in vb 6.0

Hi guys! in this topic I will teach you how to load a rich text file in visual basic 6.0. like the image above. but before anything else you must first create a ".rtf" or ".RTF" file extension in Microsoft Office Word or any spreadsheet that can create those file extension and then save it as "myword.rtf" or "myword.RTF". after that in Visual Basic interface click the component Rich Textbox and drag it to the form. The following is sample code on how to load rich text file. Hope this one helps you. Happy Coding! :)



Private Sub Form_Load()
RichTextBox1.LoadFile ("C:\Documents and Settings\Yves\Desktop\yves.rtf")
End Sub

Note:
    - the text inside the double quote(" ") are the path of your ".rtf" or ".RTF" file.

No comments:

Post a Comment