Private Sub Ouvrir_Click() Open "fichier source" For Input As #1 Do If EOF(1) Then Exit Sub Line Input #1, Var Text1.Text = Text1.Text + Var Loop Until EOF(1) Close #1 End Sub
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionPrivate Sub Ouvrir_Click() Dim Var As String On Error GoTo Cancel CommonDialog.FileName = "" CommonDialog.Filter = "Fichier TEXTE (*.txt)|*.txt" ' Pour Word CommonDialog.Flags = cdlOFNLongNames Or cdlOFNFileMustExist Or cdlOFNHideReadOnly Or cdlOFNPathMustExist ' Options de la Boîte de Dialogue CommonDialog.ShowOpen If CommonDialog.FileName <> "" Then Open CommonDialog.FileName For Input As #1 Do If EOF(1) Then Exit Sub Line Input #1, Var Text1.Text = Text1.Text + Var Loop Until EOF(1) Close #1 Cancel: End Sub
Do While Not EOF(1) Line Input #1, Var Text1.Text = Text1.Text & vbCr & Var Loop