Hello,
I have created an excel that saves a sheet to a pdf file and attach it to an email.
I want to make an email that must be sent to a string of people that have to aprove the pdf file before it will be sent to a customer. if it is possible I want to use the voting button option of outlook.
below you see the excel vba code:
Sub mail()
Range("G1").Select 'Selecteer cel F8
ActiveCell.Value = Range("L4") & Range("L6").Value
Range("J1").Select
Range("J1").Value = Range("A2").Value + 1
Range("A2").Value = Range("J1")
Dim Default
fdir = "G:\fielddpt\Rawinfo\Peter\"
Default = Range("L3") & " " & Range("G1") & Range("J1") & " " & Range("C4") & " " & Range("L5")
fname = InputBox("Please Enter Filename", Default, Default)
fpath = fdir & fname & ".pdf"
With Application
> EnableEvents = True
> ScreenUpdating = False
End With
ToAddress = ActiveSheet.Range("L7").Value
CCAddress = "xx@xx[EMAIL="BramJille@lambweston-nl.com"].com [/EMAIL]"
MailSub = "Emailing " & fname
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
fpath, Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
'Create Mail & attach PDF
Set oOutlookApp = CreateObject("Outlook.Application")
'Create a new message
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
> Display
End With
Signature = oItem.HTMLbody
With oItem
> To = ToAddress
> CC = CCAddress
> Subject = MailSub
> HTMLbody = " <br><br>" & _
"<br><br>" & Signature
'Bring up new mail window
oItem.Display
'Add Attachment
oItem.Attachments.Add fpath
'Cleanup , baby
Set OutMail = Nothing
Set OutApp = Nothing
Set fs = CreateObject("Scripting.FileSystemObject")
End With
End Sub
I have created an excel that saves a sheet to a pdf file and attach it to an email.
I want to make an email that must be sent to a string of people that have to aprove the pdf file before it will be sent to a customer. if it is possible I want to use the voting button option of outlook.
below you see the excel vba code:
Sub mail()
Range("G1").Select 'Selecteer cel F8
ActiveCell.Value = Range("L4") & Range("L6").Value
Range("J1").Select
Range("J1").Value = Range("A2").Value + 1
Range("A2").Value = Range("J1")
Dim Default
fdir = "G:\fielddpt\Rawinfo\Peter\"
Default = Range("L3") & " " & Range("G1") & Range("J1") & " " & Range("C4") & " " & Range("L5")
fname = InputBox("Please Enter Filename", Default, Default)
fpath = fdir & fname & ".pdf"
With Application
> EnableEvents = True
> ScreenUpdating = False
End With
ToAddress = ActiveSheet.Range("L7").Value
CCAddress = "xx@xx[EMAIL="BramJille@lambweston-nl.com"].com [/EMAIL]"
MailSub = "Emailing " & fname
ActiveSheet.ExportAsFixedFormat Type:=xlTypePDF, FileName:= _
fpath, Quality:=xlQualityStandard, _
IncludeDocProperties:=False, IgnorePrintAreas:=False, OpenAfterPublish:=False
'Create Mail & attach PDF
Set oOutlookApp = CreateObject("Outlook.Application")
'Create a new message
Set oItem = oOutlookApp.CreateItem(olMailItem)
With oItem
> Display
End With
Signature = oItem.HTMLbody
With oItem
> To = ToAddress
> CC = CCAddress
> Subject = MailSub
> HTMLbody = " <br><br>" & _
"<br><br>" & Signature
'Bring up new mail window
oItem.Display
'Add Attachment
oItem.Attachments.Add fpath
'Cleanup , baby
Set OutMail = Nothing
Set OutApp = Nothing
Set fs = CreateObject("Scripting.FileSystemObject")
End With
End Sub