Quand je met ChDir "c:\" j'atteri bien à la racine de C
mais quand je veut atterir à la racine d'une partition G ca ne fonctionne pas
Sub envoiemailpiecejointe()
Dim ObjOutlook As New Outlook.Application
Dim oBjMail
Dim Nom_Fichier
Set ObjOutlook = New Outlook.Application
Set oBjMail = ObjOutlook.CreateItem(olMailItem)
ChDir "c:\"
Nom_Fichier = Application.GetOpenFilename(Title:="Selection de tous les fichiers", MultiSelect:=True)
If Not IsArray(Nom_Fichier) Then Exit Sub
With oBjMail
.Display ' Ici on peut supprimer pour l'envoyer sans vérification
.To = "ECRIRE EMAIL CLIENT" ' le destinataire
'.BCC = "" 'adresse destinataires pour info
.Subject = "ECRIRE OBJET " ' l'objet du mail
.HTMLBody = "ECRIRE LE CONTENU DU MAIL " 'le corps du mail
.BodyFormat = olFormatHTML 'signature outlook
For i = 1 To UBound(Nom_Fichier)
.Attachments.Add Nom_Fichier(i) '"C:\Data\essai.txt" ' ou Nomfichier
Next
End With
Set oBjMail = Nothing
Set ObjOutlook = Nothing
End Sub