Bonjour les amis,
je lance un sujet qui a déjà été abordé à plusieurs reprise, et bien expliqué par kiki29, mais je n'arrive pas à adapter à mon cas.
mon userform récupère à partir d'un combobox ma liste de clients et en fonction du nom récupère les fichiers pdf dans mes textbox, jusque la tout va bien, je peux même les ouvrir.
cependant j'aimerai pouvoir afficher l'aperçu de ce fichier dans un AcroPDF, mais c'est là que je m'en sort pas.
ci dessous un aperçu de l'userform et le code de celui ci.
en vous remerciant d'avance
Pièce jointe 251221

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
Private Sub ComboBox24_Change()
ListBox5.Clear
ListBox6.Clear
With Sheets("clients")
maposi = ComboBox24.ListIndex + 7
End With
 
Chemin = "E:\Comptabilite\Data\Devis\*" & Me.ComboBox24.Value & ".pdf"
Fichier = Dir(Chemin)
Do While (Len(Fichier) > 0)
Me.ListBox5.AddItem Fichier
Fichier = Dir()
Loop
Chemin = "E:\Comptabilite\Data\Facture\*" & Me.ComboBox24.Value & ".pdf"
Fichier = Dir(Chemin)
Do While (Len(Fichier) > 0)
Me.ListBox6.AddItem Fichier
Fichier = Dir()
Loop
End Sub
 
Private Sub CommandButton53_Click()
On Error Resume Next
Dim nomf As String
nomf = ListBox5.Value
ThisWorkbook.FollowHyperlink "E:\Comptabilite\Data\Devis\" & nomf & ""
On Error GoTo 0
End Sub
 
Private Sub CommandButton54_Click()
On Error Resume Next
Dim nomf As String
nomf = ListBox6.Value
ThisWorkbook.FollowHyperlink "E:\Comptabilite\Data\Facture\" & nomf & ""
On Error GoTo 0
End Sub
 
Private Sub ListBox5_Click()
'c'est la que je ne sait plus comment faire
 
 
End Sub
 
Private Sub ListBox6_Click()
'c'est la que je ne sait plus comment faire
 
 
End Sub
 
Private Sub CommandButton55_Click()
ComboBox24.Value = "Sélectionner client"
ListBox5.Clear
ListBox6.Clear
End Sub
 
Private Sub CommandButton60_Click()
Unload Historique_clients
Unload Clients
End Sub
 
Private Sub CommandButton61_Click()
Unload Historique_clients
End Sub
 
Private Sub TextBox54_Change()
Dim Texte As String
Texte = TextBox54.Text
Select Case Len(Texte)
Case 2, 5, 8, 11
Texte = Texte & " "
End Select
TextBox54.Text = Texte
If InStr("0123456789", Chr(KeyAscii)) = 0 Then KeyAscii = 0
With Worksheets("Clients")
Dim derlign As Integer
Dim plage As Range
derlign = Worksheets("Clients").Range("H65536").End(xlUp).Row
Set plage = Worksheets("Clients").Range("G7" & ":H" & derlign)
numero = TextBox54.Value 'a definir suivant la recherche
For Each Cell In plage
If Cell.Value = numero Then
ComboBox24.Value = Worksheets("Clients").Range("A" & Cell.Row)
End If
Next Cell
End With
End Sub
 
Private Sub UserForm_activate()
ComboBox24.List = Fo_SansDoublonsTrié(Worksheets("Clients").Range("A7:A" & Worksheets("Clients").Range("H65536").End(xlUp)(2, 0).Row)) 'Fonction''
ComboBox24.Value = Clients.ComboBox2.Value
End Sub