Re : Créer un lien hypertexte automatiquement
Bonjour,
J ai avancé seul mais j obtiens une erreur sur la derniere action de ma macro, pouvez vous m aider?
Private Sub CommandButton1_Click()
*
Const UnSignet As String = "debut"
Const DeuxSignet As String = "fin"
Const TroixSignet As String = "debut2"
Const QuatreSignet As String = "fin2"
Const CinqSignet As String = "deb"
Const SixSignet As String = "fi"
*
'Déclare le variable Range
Dim debutRge As Range
Dim finRge As Range
Dim copyRge As Range
*
'Assigne les variables
With ActiveDocument
Set debutRge = .Bookmarks(UnSignet).Range
Set finRge = .Bookmarks(DeuxSignet).Range
Set debut2Rge = .Bookmarks(TroixSignet).Range
Set fin2Rge = .Bookmarks(QuatreSignet).Range
Set debut3Rge = .Bookmarks(CinqSignet).Range
Set fin3Rge = .Bookmarks(SixSignet).Range
*
*
Set copyRge = _
.Range(debutRge.End, finRge.Start)
Set copyRge2 = _
.Range(debut2Rge.End, fin2Rge.Start)
Set copyRge3 = _
.Range(debut3Rge.End, fin3Rge.Start)
*
MsgBox (copyRge)
MsgBox (copyRge2)
*
ChDrive "T:/"
*
If Dir("T:\MA\" & copyRge, vbDirectory) = "" Then MkDir ("T:\MA\" & copyRge)
*
ChDrive "T:/"
*
If Dir("T:\MA\" & copyRge & "\" & copyRge2, vbDirectory) = "" Then MkDir ("T:\MA\" & copyRge & "\" & copyRge2)
*
MsgBox (copyRge3)
*
*** ActiveDocument.Hyperlinks.Add Anchor:=copyRge3, Address:=copyRge3, _
********SubAddress:="", ScreenTip:="", TextToDisplay:=copyRge3
*
*
D avance merci pour votre aide!