|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Abrir e Salvar sem Declarar Nada (Modulo)
|
|
|
|
Postada em 1/3/2007 por Edinei
neisjb@hotmail.com
'Coloque no form 2 CommandButtons
Private Sub Command1_Click() CommonDialog1.Filter = "Arquivos Texto (*.TXT)|*.TXT" CommonDialog1.ShowOpen If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Input Access Read As #1 Do While Not EOF(1) texto = texto & Input(1, #1) Loop Text1.Text = texto Close #1 End If
End Sub
Private Sub Command2_Click() CommonDialog1.Filter = "Arquivos Text (*.TXT)|*.txt" CommonDialog1.ShowSave If CommonDialog1.FileName <> "" Then Open CommonDialog1.FileName For Output As #1 Print #1, Text1.Text Close #1 End If End Sub
|
|
|
|
|