bijgaande script werkt goed doch het mailen zou automatisch moeten gebeuren naar adressen die in sheet staan
Nu staat mijn mailadres geprogrammeerd in VB script
graag had ik gehad dat er gemaild werd naar mailadres in cel B4 & I12
Nu staat mijn mailadres geprogrammeerd in VB script
graag had ik gehad dat er gemaild werd naar mailadres in cel B4 & I12
Code:
Sub pdf()
Dim Pad As String
Dim Bst As String
Dim Otv As String
Dim OutApp As Object
Dim OutMail As Object
Pad = "H:\Test"
Otv = "..."
Bst = ActiveSheet.Name & ".pdf"
ActiveSheet.Range("A1:L102").ExportAsFixedFormat _
Type:=xlTypePDF, _
FileName:=Pad & "\" & Bst, _
Quality:=xlQualityStandard, _
IncludeDocProperties:=True, _
IgnorePrintAreas:=False, _
OpenAfterPublish:=False
Set OutApp = CreateObject("Outlook.Application")
Set OutMail = OutApp.CreateItem(0)
With OutMail
.to = Otv
.CC = ""
.BCC = ""
.Subject = "trainingsschema"
.Body = "zie bijlage"
.Attachments.Add Pad & "\" & Bst
.Send
End With
End Sub
Laatst bewerkt: