Reputation: 1753
I had a simple but very important vba rule in Outlook.
This morning my Office upgraded to 16.0.7531.1003 version (64 bit) and
I found my rule unchecked and trying to check it I get message "This rule is unavailable in current mode" (this is a translation as I am not using English version of Outlook).
Furthermore, the option "run script" is no longer visible while trying to configure a new rule.
The only thing the rule does is searching new email body for valid GUID, and if any exists, it inserts the GUID and email SentOn date into database.
Did Microsoft disable VBA rules at all?
Public Sub getGUID(receiptItem As MailItem)
Dim regE As New RegExp
Dim matches As MatchCollection
Dim sql As String: sql = "insert HDSDEB.dbo.ReportCalendar_received(ReportGUID, SentDatetime) values ('__GUID__', '__SentOn__');"
regE.Pattern = "[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}"
regE.IgnoreCase = True
regE.MultiLine = True
Set matches = regE.Execute(receiptItem.body)
If matches.Count = 0 Then Exit Sub
Debug.Print matches.Item(0).Value
sql = Replace(sql, "__GUID__", matches.Item(0).Value)
sql = Replace(sql, "__SentOn__", receiptItem.SentOn)
SQLQueryRun (sql)
Debug.Print sql
End Sub
Upvotes: 3
Views: 3378