Bonjour
j'ai une macro qui fonctionne bien à condition d'indiquer le chemin du fichier à ouvrir.
J'aimerai que le lien soit repris depuis la cellule A1. Voir code ci-dessous.
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "body of email" & "<a href=""D:\Fichier1.xlsm""> ici</a>" & " Merci"
strbody = "body of email" & "<a href=""Chemin pris dans cellule A1""> ici</a>" & " Merci"
On Error Resume Next
With OutMail
.To = "whoever@microsoft.com"
.Subject = "Hyperlien"
.HTMLBody = strbody
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Par avance Merci.
Vmax
j'ai une macro qui fonctionne bien à condition d'indiquer le chemin du fichier à ouvrir.
J'aimerai que le lien soit repris depuis la cellule A1. Voir code ci-dessous.
Dim OutApp As Object
Dim OutMail As Object
Dim strbody As String
Set OutApp = CreateObject("Outlook.Application")
OutApp.Session.Logon
Set OutMail = OutApp.CreateItem(0)
strbody = "body of email" & "<a href=""D:\Fichier1.xlsm""> ici</a>" & " Merci"
strbody = "body of email" & "<a href=""Chemin pris dans cellule A1""> ici</a>" & " Merci"
On Error Resume Next
With OutMail
.To = "whoever@microsoft.com"
.Subject = "Hyperlien"
.HTMLBody = strbody
.Display
End With
On Error GoTo 0
Set OutMail = Nothing
Set OutApp = Nothing
End Sub
Par avance Merci.
Vmax