avisoft20
Board Regular
- Joined
- Sep 10, 2016
- Messages
- 64
Hi All ,
Code is working for email.But while insert code for Button disable after a given date period , Button is not disabled.
Code is working for email.But while insert code for Button disable after a given date period , Button is not disabled.
VBA Code:
Sub Button1_Click()
Macros_ExpirationExceeded = Date >= #7/23/2021# 'mm/dd/yyyy'
email
End Function
Public Function email()
Dim fnum As Integer
Dim lnum As Integer
lnum = 1
Dim tt1 As String
Dim tt2 As String
For fnum = 1 To lnum
tt1 = "b" & fnum
tt2 = "a" & fnum
tt3 = "c" & fnum
tt4 = "d" & fnum
esub = Range(tt4).Value
sendto = Range(tt1).Value
fname = Range(tt2).Value
cc = Range(tt3).Value
Set app = CreateObject("Outlook.Application")
Set itm = app.createitem(0)
With itm
.Subject = esub
.to = sendto
.cc = cc
.attachments.Add (fname)
.display
.send
End With
Set app = Nothing
Set itm = Nothing
Next fnum
Thanks & Regards,
Avisoft20
End Function
Last edited by a moderator: