Condividi:        

ALLEGARE FILE A MAIL

Vuoi potenziare i tuoi documenti Word? Non sai come si fa una macro in Excel? Devi creare una presentazione in PowerPoint?
Oppure sei passato a OpenOffice e non sei sicuro di come lavorare al meglio?

Moderatori: Anthony47, Flash30005

ALLEGARE FILE A MAIL

Postdi scanacc » 13/07/20 13:03

Buongiorno, io e un altro mio collega usiamo un programmino per inviare le mail e allegare un file.
Codice: Seleziona tutto
Sub MAILAnteprima()
Dim OutApp As Object
Dim OutMail As Object
Dim EmailAddr As String
Dim Subj As String
Dim BodyText As String
Const LF = vbCrLf

Set OutApp = CreateObject("Outlook.Application")

If Cells(Range("I4").Value, "T").Value <> "" Then
Application.Run "REPORT_RUPM_creo_pdf" '<-- con questa stampo in pdf il REPORT RUPM
Application.Run "REPORT_RUPM_SMALL_creo_pdf" '<-- con questa stampo in pdf il REPORT RUPM

End If

    Sheets("INVIA MAIL").Select
    'Il comando OutFile serve per mandare 1 allegato
OutFile = Cells(Range("I4").Value, "Q").Value
OutFile1 = Cells(Range("I4").Value, "T").Value

For i = 5 To Range("J1000").End(xlUp).Row
    BDT = BDT & Cells(i, "J") & LF
Next i

''  (b)
Nominat = Cells(Range("I4").Value, "C").Value

EmailAddr = Cells(Range("I4").Value, "D").Value
Subj = Range("J4").Value

EmailAddr1 = Cells(Range("I4").Value, "E").Value
Subj = Range("J4").Value

EmailAddr2 = Cells(Range("I4").Value, "F").Value
Subj = Range("J4").Value


EmailAddr3 = Sheets("INVIA Mail").Range("N6").Value

Set OutMail = OutApp.CreateItem(0)
With OutMail
'ricevuta di ritorno NOVITA' per la conferma di recapito aggiungere --> .OriginatorDeliveryReportRequested
If Sheets("INVIA MAIL").Range("M7").Value <> "" Then
.ReadReceiptRequested = True
End If

.To = EmailAddr
.CC = EmailAddr1 & ";" & EmailAddr2 & ";" & EmailAddr3
.BCC = ""
.Subject = Subj

If Cells(Range("I4").Value, "Q").Value <> "" Then
.Attachments.Add OutFile
End If

If Cells(Range("I4").Value, "T").Value <> "" Then
.Attachments.Add OutFile1
End If

.Body = BDT
.Display

End With
Application.Wait (Now + TimeValue("0:00:01"))
Set OutMail = Nothing
Set OutApp = Nothing

'End If
   
End Sub

La cosa strana è che a me, il FILE viene allegato alla fine della mail, al mio collega invece viene allegato in un riquadro sotto l'oggetto.
Sapete il motivo?
scanacc
Utente Senior
 
Post: 350
Iscritto il: 06/12/15 10:30

Sponsor
 

Re: ALLEGARE FILE A MAIL

Postdi scanacc » 13/07/20 13:46

Risposta
Outlook -> File -> Opzioni -> Posta -> in "Scrittura Messaggi" selezionare HTML o TESTO NORMALE

https://support.microsoft.com/it-it/help/2462816
scanacc
Utente Senior
 
Post: 350
Iscritto il: 06/12/15 10:30


Torna a Applicazioni Office Windows


Topic correlati a "ALLEGARE FILE A MAIL":


Chi c’è in linea

Visitano il forum: Marius44 e 53 ospiti