How to open a file with one line of code!
You create a funtion that can open a file with just one line of code.
AI
Resumo por IA: This codebase represents a historical implementation of the logic described in the metadata. Our preservation engine analyzes the structure to provide context for modern developers.
Código fonte
Public Function Openf(frm As Form, Text As RichTextBox, Dialog As CommonDialog)
On Error Resume Next
Dialog.Filter = "Text Files (*.txt)|*.txt|All Files (*.*)|*.*|" 'Edit the filter how you want it
Dialog.Flags = cdlOFNPathMustExist & cdlOFNHideReadOnly
Dialog.Action = 1
Screen.MousePointer = vbHourglass
Text.Text = ""
Text.LoadFile Dialog.filename
frm.Show
frm.Refresh
Screen.MousePointer = vbNormal
End Function
Private Sub Command1_Click()
Call Openf(Me, RichTextBox1, CommonDialog1)
End Sub
Comentários originais (3)
Recuperado do Wayback Machine