Bonjour le forum,
J'utilise ce code sous Windows qui fonctionne très bien.
Sub Email()
Dim olApp As Outlook.Application
Dim olMail As MailItem
Dim CurFile As String
Set olApp = New Outlook.Application
Set olMail = olApp.CreateItem(olMailItem)
CurFile = "C:\Archives" & "\" & Range("B13").Value & " - " & Day(Date) & "-" & Month(Date) & "-" & Year(Date) & ".pdf"
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, Filename:=CurFile, _
Quality:=xlQualityStandard, IncludeDocProperties:=False, IgnorePrintAreas:=False, _
OpenAfterPublish:=False
With olMail
.To = "@gmail.com"
.CC = "@gmail.com"
.Subject = "Main courante Flashover"
.Body = "Message"
.Attachments.Add CurFile
.Display
End With
Set olMail = Nothing
Set olApp = Nothing
End Sub
Savez-vous comment le retranscrire pour Mac ?
J'ai fais plein de tentatives cet après-midi, mais sans succès.
J'ai tenté pour palier à l'activeX de Windows (C:\Program Files (x86)\Common Files\Microsoft Shared\OFFICE16\MSOUTL.OLB) non pris en charge par Mac.
Outlook.Application.ActiveExplorer.CurrentFolder
Mais idem, pas de sucés aux différents tests.
Avez-vous une idée ?
Merci.