Afficher un message
Vieux 21/05/2006, 20h01   #4 (permalink)
Hervé
XLDnaute Barbatruc
 
Avatar de Hervé
 
Date d'inscription: février 2005
Localisation: Saint-Etienne
Version Excel : Excel XP (PC)
Messages: 4 453
Par défaut Re:images et commentaires dans userform

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
Hervé est déconnecté   Réponse avec citation