Hello all
I hope someone can help on this
I have a workbook called "Test" with a worksheet called "Keyword"
In column "A" there is a date, column "B" a question
The code below so I'm told looks at the date and if it matched todays date will then email out the question is column "B"
Trouble is it bugs out on "TodayKeyword"
Any idea's please
[Sub MailOutKeyword()Dim DailyKeyword As String
DailyKeyword = TodayKeyword("C:\tmp\Test.xlsx")
Select Case DailyKeyword
Case "Error"
MsgBox "An error occurred while trying to distribute the daily Question Email.", vbInformation, "Error"
Case "None"
MsgBox "No Keyword was found for today.", vbInformation, "No Keyword Found"
Case "Sent"
Case Else
Dim objMail As Outlook.MailItem
Set objMail = CreateItem(olMailItem) 'send email
With objMail
.BodyFormat = olFormatPlain
.Subject = "Branch question " & Format(Date, "dd-mm-yyyy")
.HTMLBody = "<p>Todays question is:<br><br><b>" & DailyKeyword & "</b></p>"
.To = "Joe Bloggs"
.Display
End With
Set objMail = Nothing
End Select
End Sub]
I hope someone can help on this
I have a workbook called "Test" with a worksheet called "Keyword"
In column "A" there is a date, column "B" a question
The code below so I'm told looks at the date and if it matched todays date will then email out the question is column "B"
Trouble is it bugs out on "TodayKeyword"
Any idea's please
[Sub MailOutKeyword()Dim DailyKeyword As String
DailyKeyword = TodayKeyword("C:\tmp\Test.xlsx")
Select Case DailyKeyword
Case "Error"
MsgBox "An error occurred while trying to distribute the daily Question Email.", vbInformation, "Error"
Case "None"
MsgBox "No Keyword was found for today.", vbInformation, "No Keyword Found"
Case "Sent"
Case Else
Dim objMail As Outlook.MailItem
Set objMail = CreateItem(olMailItem) 'send email
With objMail
.BodyFormat = olFormatPlain
.Subject = "Branch question " & Format(Date, "dd-mm-yyyy")
.HTMLBody = "<p>Todays question is:<br><br><b>" & DailyKeyword & "</b></p>"
.To = "Joe Bloggs"
.Display
End With
Set objMail = Nothing
End Select
End Sub]