bonjour titin, david, thomas, le forum
une autre syntaxe possible :
Citation:
Dim i As Integer
Dim chemin As String, texte As String
Dim image As String
Dim fichiertxt As String
Dim lignetxt As String
Dim nom2 As String
Dim premier As Byte
chemin = 'h:\\\\\\\\images\\\\\\\\'
nom2 = Me.ListBox2.Value
image = chemin & nom2 & '.jpg'
fichiertxt = chemin & nom2 & '.txt'
Open fichiertxt ForInputAs #1
DoWhileNot EOF(1)
Input #1, lignetxt
* * * * If premier = 0 Then
* * * * * * * * texte = lignetxt
* * * * * * * * premier = 1
* * * * Else
* * * * * * * * texte = texte & vbNewLine & lignetxt
* * * * End If
Loop
Close #1
IfNot Dir(image) = '' Then
Me.Image1.Picture = LoadPicture(image)
Me.Label1 = texte
Else
Me.Image1.Picture = LoadPicture('C:monImageDeRemplacement.jpg')
Me.Label1 = ''
End If
|
salut