Afficher un message
Vieux 08/10/2007, 21h57   #3 (permalink)
Staple1600
XLDnaute Barbatruc
 
Avatar de Staple1600
 
Date d'inscription: juin 2005
Localisation: RENNES
Messages: 4 946
Par défaut Re : Excel VBA et Outlook...

Bonsoir


A tester

(Cocher la Référence à Microsoft Outlook objetc Library
Dans VBE Outils/Réfrérences)

Code:
sub hypertext_email()
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 = "<A HREF=""\\Mes Documents\Photos 2007"">Photos 2007</A>"
On Error Resume Next
    With OutMail
        .To = "toto@toto.fr"
        .CC = ""
        .BCC = ""
        .Subject = "Lien hypertexte"
        .HTMLBody = strbody
        .BodyFormat = olFormatHTM
        .Display
    End With
    On Error GoTo 0
 
    Set OutMail = Nothing
    Set OutApp = Nothing
End Sub
source:ici
Staple1600 est déconnecté   Réponse avec citation