2017-10-06 2 views
0

J'ai créé un code VBA inwhic il envoie automatiquement un e-mail. Dans cet e-mail, j'aimerais avoir un lien hypertexte vers une page Web où j'ai téléchargé un fichier.Mettre un lien hypertexte dans le code VBA pour les e-mails automatiques

Le problème que je rencontre est de mettre les balises HTML Hyperlink dans le code VBA.

Vérifiez mon code:

msgbody = "Hi Everyone" & "<br> <br>" _ 
& "I have attached the excel file to this afternoon's Open Order Report above, as well as provided the link below:" & "<br> <br>" _ 
& "Please reach out if you have any more questions or concerns" & "<br>" 
& "<a href= & "www.google.com">" & "link" </a>" 

With objemail 
    .to = "[email protected]" 
    .cc = "" 
    .Subject = "test" 
    .htmlbody = msgbody 
    .display 
End With 

End Sub 
+0

voir ici https://stackoverflow.com/questions/15224280/adding- hyperliens-vers-excel-email-body-text – QHarr

+2

Possible duplication de [Ajout de liens hypertexte pour exceler le texte du corps de l'e-mail] (https://stackoverflow.com/quest ions/15224280/ajouter-hyperliens-à-excel-email-corps-texte) – glennsl

Répondre

2

Remplacer ceci:

& "<a href= & "www.google.com">" & "link" </a>" 

avec ce

& "<a href=" & """" & "www.google.com" & """" & ">" & "link" </a>"