Una famiglia di sistemi di gestione per database relazionali di Microsoft progettati per semplificare l'uso.
ciao Andrea,
copia il codice sotto indicato in un modulo standard.
e aggiungi questa riga di codice subito dopo la generazione del file pdf.
Se vuoi inviare l'email anziché mostrarla usa il metodo send al posto di displey ( vedi sotto in grassetto.)
ciao, Sandro.
Ps. chiedo scusa per la formattazione ma non riesci a selezionare codice nel formato...
sendEmail2OL2 strConsignee:="indirizzoEmaiDestinatario@dominio.xxxxx", _
strname:="FullPathNameDellAllegatoDaInviare", _
OggettoEmail:="OggettoEmail", _
TestoEmail:="TestoEmail"
in un modulo standard:
Option Compare Database
Option Explicit
Private OlApp As Object
Private folderOL As Object
Private namespaceOutlook As Object
'
Public Sub newOlIstance2()
On Error Resume Next
Set OlApp = GetObject(, "Outlook.Application")
If OlApp Is Nothing Then
Set OlApp = CreateObject("Outlook.Application")
Set namespaceOutlook = OlApp.GetNamespace("MAPI")
Set folderOL = namespaceOutlook.GetDefaultFolder(0)
folderOL.Display
Else
Set namespaceOutlook = OlApp.GetNamespace("MAPI")
End If
End Sub
Public Sub sendEmail2OL2(ByVal strConsignee As String, _
ByVal strname As String, _
ByVal OggettoEmail As String, _
ByVal TestoEmail As String)
newOlIstance2
Dim mailOutlook As Object
Dim olMailItem As Object
Dim i As Integer
Set mailOutlook = OlApp.CreateItem(0)
With mailOutlook
.Subject = OggettoEmail
.To = strConsignee
.Body = TestoEmail
.Attachments.Add strname
.Display
End With
Set mailOutlook = Nothing
Set olMailItem = Nothing
setOl2Nothing2
End Sub
Public Sub setOl2Nothing2()
Set OlApp = Nothing
Set namespaceOutlook = Nothing
End Sub