locked
Rich text file creation RRS feed

  • General discussion

  • Two tasks; 1) Search a specified folder for a rich text file. If it doesn't exist then create the rich text file. The file name includes the current date. Over time many rich text files will be created. 2) The user should be allowed to view previuosly generated rich text files. When a user selects a file it is loaded into a rich text box.

    Looking through the snippets I find code that deals with standard text files which doesn't help me out. Searched the MSDN Library for awhile. My search skills must need improvement. Didn't get any where with index search, filtered for Visual Basic. Looked through Visual Basic 2005: The Language, basically deals with text files.

    So, I need to create a rich text file with code. I can contruct the file path\name, search for the file, decide whether to create or Load and I can save the rich text file.

    Any ideas?

    Wednesday, January 10, 2007 9:56 PM

All replies

  • You can use the richtextbox control to create a rich text file.

    Code Snippet

    Dim tbx As New System.Windows.Forms.RichTextBox

    tbx.SaveFile("The Path and Filename", RichTextBoxStreamType.RichText)

     

    Thursday, January 11, 2007 7:20 AM