Bonjour à la communauté.
Je tente de faire un document avec un exemple de toutes mes polices installées (plus de 7000).
J'ai écris un code, mais le tri à bulle ne fonctionne tout simplement pas. Et pourtant, je l'utilise souvent...
Voici ce code :
Si quelqu'un a une astuce, un conseil, je suis preneur.
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 Sub ListePolicesInstallées() Documents.Add Dim Compt As Integer, Lign As Integer, LstPolice() As String Compt = 1 For Each PolicesCar In FontNames With Selection Compt = Compt + 1 End With Next ReDim LstPolice(Compt) Lign = 1 For Each PolicesCar In FontNames With Selection LstPolice(Lign) = PolicesCar Lign = Lign + 1 End With Next 'Tri à bulles ************************** Dim i As Integer, j As Integer, k As Integer, v As Integer If loBound = -1 Then loBound = LBound(LstPolice()) If upBound = -1 Then upBound = UBound(LstPolice()) k = upBound For i = loBound + 1 To upBound v = LstPolice(i): j = i While LstPolice(j - 1) > v LstPolice(j) = LstPolice(j - 1): j = j - 1 Wend LstPolice(j) = v Next i For Lign = 1 To UBound(LstPolice()) With Selection .Font.Name = "Arial" .Font.Size = 12 .Font.Underline = 1 .Font.Italic = False .ParagraphFormat.Alignment = 0 .Font.Bold = True .TypeText Text:=LstPolice(Lign) .TypeParagraph End With With Selection .Font.Name = LstPolice(Lign) .Font.Bold = False .Font.Underline = 0 .TypeText Text:="Ex : servez un whisky au juge blond qui fume la pipe" & vbLf & "0123456789&é(-è_çà)=#{[|`\^@]}/*-+.ôï$£*µù%!§:/;.,?" .TypeParagraph End With 'If Lign > 20 Then Exit Sub Next End Sub
Denis.
Partager