'Sending email reminder every 14 days from a Date

Good afternoon. I am using VBA code within an Excel file and would like additional code lines to send a recurring email reminder if the file has not been saved within 14 days. Following is the code I use. I've searched, but have not found additional code to accomplish what I am after. Thank you in advance for your expertise and assistance. Sub SEND_Colleague()

Dim MyFile As String
MyFile = ActiveWorkbook.Name
Application.DisplayAlerts = False
ActiveWorkbook.SaveAs Filename:= & MyFile
Set OutlookApp = CreateObject("Outlook.Application")

Set OutlookMail = OutlookApp.CreateItem(0)
On Error Resume Next
On Error GoTo 0
With OutlookMail
    .to = "[email protected]"
    .Importance = 2
    .Subject = ActiveWorkbook.Name
    If InStr(Filename, ".") > 0 Then
        End If
    .HTMLbody = "<html><body><p><font size=4>My Colleague: <p></p>" _
    & "</p><p>Please navigate to the tracking log named in the subject line of this email by clicking the link below and update the <b><i>Product</i></b> section of the log. <p></p>" _
    & "Once your updates are entered, click the form control button in <b>Cell B61</b>. The workbook will be saved to the Network shared folder and closed automatically.  Thereafter, the Outlook mail program will be initiated and a pop-up warning message will appear.  Click <u><b>Allow</b></u> and an email will be sent to the area leader.  A copy of the email can be found in your Outlook <i>Sent</i> folder.<p>" _
    & "</p><p><b><FONT COLOR=red>Note, you must return to this log and follow the steps above every 14 days until all thrid-party claims are fully adjudicated. </p></b><FONT COLOR=black>" _
    & "</p><p>Thank You</p>" _
    
    .SEND
    End With
    Set OutlookMail = Nothing
    Set OutlookApp = Nothing
    ActiveWorkbook.Close
    End Sub


Solution 1:[1]

You want to make a check to see if the last edit date is greater than 14 days.

You can access the workbook's information with ThisWorkbook.BuiltInDocumentProperties, which will return a collection of the file's properties. The date last modified should have index 12. Then, store the value of the file's last modified date:

Dim DateLastModified As Date
DateLastModified = ThisWorkbook.BuiltinDocumentProperties(12)

And then just compare that date to today's date (and time if you wish, because ThisWorkbook.BuiltinDocumentProperties(12) also contains time information).

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 TehDrunkSailor