Outlook reminder with excel worksheet
Hey Guys,
Does any one have any idea about how can i create reminders based on dates in a excel workbook? I would like to assign my workbook with dates to follow up with various assignments. I want my Outlook to open the Excel file showing me the dates and reminders for a particular assignment. Can any one guide me through that how can i do so? Any help on this would be appreciated.
Thanks.
Re: Outlook reminders with excel worksheet
Open the workbook you wish to place the code in.Open the VBE (Visual Basic Editor) by pressing ALT+F11 keys.Insert a code module. Use the menus Insert and Module.Then simply paste the code.
Re: Outlook reminders with excel worksheet
You can use following vb code.
Visual basic code to create Outlook task with reminder.
Code:
Function AddOutLookTask()
Dim appOutLook As Outlook.Application
Dim taskOutLook As Outlook.TaskItem
Set appOutLook = CreateObject("Outlook.Application")
Set taskOutLook = appOutLook.CreateItem(olTaskItem)
With taskOutLook
.Subject = "This is the subject of my task"
.Body = "This is the body of my task."
.ReminderSet = True
.ReminderTime = DateAdd("n", 2, Now) ' Set to remind us 2
' minutes from now.
.DueDate = DateAdd("n", 5, Now) ' Set the due date to
' 5 minutes from now.
.ReminderPlaySound = True
'add the path to a .wav file on your computer.
.ReminderSoundFile = "C:\Win95\media\ding.wav"
.Save
End With
End Function
Hope so it may help you out.:thumbup1:
Re: Outlook reminders with excel worksheet
You can also follow the below steps.
1. "Dim StartingRow, RequestCount As Integer" - in VBA, this
translates to "Dim StartingRow As Variant, RequestCount As Integer"
If you are trying to declare both variables as integers, try "Dim
StartingRow As Integer, RequestCount As Integer". The same goes for
"Dim ExtractedAsset, ExtractedUser As String" I think you meant "Dim
ExtractedAsset As String, ExtractedUser As String"
In other words you can share the "Dim", but not the declaration part.
2. "Set myOlApp = CreateObject("Outlook.Application")"
You might want to check if you are already running Outlook, then you
can substitute this code to use the existing instance instead of
always starting a new one:
On Error Resume Next
Set myOlApp = GetObject(, "Outlook.Application")
If Err.Number <> 0 Then
Set myOlApp = CreateObject("Outlook.Application")
End If
On Error GoTo 0
If myOlApp Is Nothing Then
MsgBox "Could not start Outlook!"
Exit Sub
End If
Or, since you have a reference to the Outlook object library, "Set
myOlApp = New Outlook.Application". CreateObject & GetObject are
really for late-bound code. That being said, I use it all the time.
3. "StartingRow = Selection.Row"
You can eliminate this part of your code and fix the rest so that you
could run it in a loop on multiple rows. For example here is the
cleaned up code.
Re: Outlook reminders with excel worksheet
Would there be a way to set this up for mulitple reminders. I need a reminder set for 20 mins, 2 hours, 3 hours, 4 days, and 5 days. These numbers are always constant.
Re: Outlook reminders with excel worksheet
Quote:
Originally Posted by
Jbea
Would there be a way to set this up for mulitple reminders. I need a reminder set for 20 mins, 2 hours, 3 hours, 4 days, and 5 days. These numbers are always constant.
I think that you can't set multiple reminders but you can set a reminder then snooze it without any problems. To mass change the reminder time, add the remind beforehand field to All appointments view then group by it. Change 1 appointment to have a 2 day reminder then drag the others to that group. (You can grab a group header and drag the entire group.)