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
|
Sub Creation_Hypertexte()
Application.DefaultFilePath = ActiveWorkbook.Path
Macro1
Range("A8").Select
MyPath = ActiveWorkbook.Path & "\"
MyName = Dir(".\", vbDirectory)
i = 0
Do While MyName <> ""
i = i + 1
If MyName <> "." And MyName <> ".." And MyName <> ActiveWorkbook.Name Then
If (GetAttr(".\" & MyName) And vbDirectory) = vbDirectory Then
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=MyName, TextToDisplay:="|=>" & MyName
ActiveCell.Font.Underline = False
ActiveCell.Offset(1, 0).Select
'--------------------------
MyName2 = Dir(".\" & MyName & "\", vbDirectory)
Do While MyName2 <> ""
If MyName2 <> "." And MyName2 <> ".." And MyName2 <> ActiveWorkbook.Name Then
If (GetAttr(".\" & MyName & "\" & MyName2) And vbDirectory) = vbDirectory Then
ActiveCell.Offset(0, 1).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=MyName & "\" & MyName2, TextToDisplay:="|=>" & MyName2
ActiveCell.Font.Underline = False
ActiveCell.Offset(1, -1).Select
End If
End If
MyName2 = Dir
Loop
MyName2 = Dir(".\" & MyName & "\", vbDirectory)
Do While MyName2 <> ""
If MyName2 <> "." And MyName2 <> ".." And MyName2 <> ActiveWorkbook.Name Then
If (GetAttr(MyName & "\" & MyName2) And vbDirectory) = vbDirectory Then
ActiveCell.Offset(0, 1).Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=MyName & "\" & MyName2, TextToDisplay:=MyName2
ActiveCell.Font.Italic = True
ActiveCell.Font.Underline = False
ActiveCell.Offset(1, -1).Select
End If
End If
MyName2 = Dir
Loop
'-----------------------------------
End If
End If
MyName = Dir(".\", vbDirectory)
For j = 0 To i
MyName = Dir
Next
Loop
With ActiveWorkbook.PublishObjects("Sommaire Auto_21817")
.HtmlType = xlHtmlStatic
.Filename = _
"Summary.htm"
.Publish (False)
End With
End Sub |
Partager