More Excel Sauce
Outlook VBA loads ThumbsUp and Smile PNG's from disk to new Email Messages with the ThisOutlookSession module:
Sub InsertThumbsUp()
InsertImage "ThumbsUp.png"
End Sub
Sub InsertSmile()
InsertImage "Smile.png"
End Sub
Private Sub InsertImage(ByVal imageName As String)
' Specify the path to the emoji image
Dim imagePath As String
imagePath = "C:\emoji\" & imageName
' Check if the image file exists
If Dir(imagePath) = "" Then
MsgBox "Image file not found: " & imagePath, vbExclamation
Exit Sub
End If
' Insert the image into the email body
Dim inspector As Outlook.inspector
Set inspector = Application.ActiveInspector
If Not inspector Is Nothing And inspector.CurrentItem.Class = olMail Then
' Check if the active item is a MailItem
Set pic = inspector.WordEditor.InlineShapes.AddPicture(imagePath)
Else
MsgBox "Please open a new email or reply to an email to insert the image.", vbExclamation
End If
End Sub
......then customize the Ribbon on New Email Messages:
First and Last Day of the current month using the DATESERIAL function (with zero for the last day)
thisDate = Date
firstDay = DateSerial(Year(thisDate), Month(thisDate), 1)
lastDay = DateSerial(Year(thisDate), Month(thisDate) + 1, 0)
Convert dates using thisdate above to IBM DB2 date format CYYMMDD where C=1 (2000's current millennium)
fromdate = ((Year(firstDay) - 1900) * 10000) + (Month(firstDay) * 100) + Day(firstDay)
todate = ((Year(lastDay) - 1900) * 10000) + (Month(lastDay) * 100) + Day(lastDay)