| Description:This code will take the text from a file and display it in a textbox. This is useful for notepad type stuff. The good thing about this code is that you can take text from any file that has text; not just .txt, .doc, etc. Useful If you created your own extension. Setup: add a 1 textbox(Text1) and 1 button(Command1) Set text1's "multiline" to true and set text1's scrollbars to "vertical" add a module(module1) ’Start Module Code here Function GetTextFromFile(txtFile, txtopen as textbox) Dim sfile As String Dim nfile As Integer nfile = FreeFile sfile = txtFile Open sfile For Input As nfile txtopen = Input(LOF(nfile), nfile) Close nfile End Function ’put in command1_click Private Sub Command1_Click() call gettextfromfile("C:\WINDOWS\Win.ini", text1) End Sub |
Display the Text of a file in a texbox |
Freelance ASP PHP web development | Web developer India Web development India| Prayagasoft - web designer India, Ecommerce developer india, Ecommerce design