Discussion:
Setting reminder in outlook based on files created / modified in word.excel
(too old to reply)
rjagathe
2010-02-20 14:09:19 UTC
Permalink
I want to take follow up action on files created /modified by
me.So,I want to automatically create an reminder in outlook whenever I
create/modify files in Word/Excel.The reminder should be 1 month /15
days from the date of creation/modification of each file.This action
may be done in background or with our knowledge.That is, whenever I
save a file,an outlook window may pop out so that I could set
reminders.

Please help.
Graham Mayor
2010-02-20 15:20:41 UTC
Permalink
Try the following Word macro to save the document and add a reminder 1 month
and 15 days hence
You could do something similar from Excel

Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strDocPath As String
Dim strDocName As String

strDate = DateAdd("m", 1, Date)
strDate = DateAdd("d", 15, strDate)
With ActiveDocument
On Error GoTo CancelledByUser
.Save
strDocPath = .FullName
strDocName = .name
End With
Set ci = ol.CreateItem(olAppointmentItem)
With ci
.Start = strDate
.ReminderSet = True
.AllDayEvent = True
.Subject = strDocName
.Categories = "Word Documents"
.Body = strDocPath & " requires processing."
.BusyStatus = olFree
.Save
End With
Set ol = Nothing
Exit Sub
CancelledByUser: 'Error handler
MsgBox "Cancelled By User", , "Operation Cancelled"
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Post by rjagathe
I want to take follow up action on files created /modified by
me.So,I want to automatically create an reminder in outlook whenever I
create/modify files in Word/Excel.The reminder should be 1 month /15
days from the date of creation/modification of each file.This action
may be done in background or with our knowledge.That is, whenever I
save a file,an outlook window may pop out so that I could set
reminders.
Please help.
rjagathe
2010-02-21 12:52:34 UTC
Permalink
Post by Graham Mayor
Try the following Word macro to save the document and add a reminder 1 month
and 15 days hence
You could do something similar from Excel
Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strDocPath As String
Dim strDocName As String
strDate = DateAdd("m", 1, Date)
strDate = DateAdd("d", 15, strDate)
With ActiveDocument
    On Error GoTo CancelledByUser
    .Save
    strDocPath = .FullName
    strDocName = .name
End With
Set ci = ol.CreateItem(olAppointmentItem)
With ci
    .Start = strDate
    .ReminderSet = True
    .AllDayEvent = True
    .Subject = strDocName
    .Categories = "Word Documents"
    .Body = strDocPath & " requires processing."
    .BusyStatus = olFree
    .Save
End With
Set ol = Nothing
Exit Sub
CancelledByUser: 'Error handler
MsgBox "Cancelled By User", , "Operation Cancelled"
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP
My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
     I want to take follow up action on files created /modified by
me.So,I want to automatically create an reminder in outlook whenever I
create/modify files in Word/Excel.The reminder should be 1 month /15
days from the date of creation/modification of each file.This action
may be done in background or with our knowledge.That is, whenever I
save a file,an outlook window may pop out so that I could set
reminders.
Please help.
Hi,
when I run the maco, the second line throws an error message "user-
defined type not defined"

Please help.

-rjagathe
Graham Mayor
2010-02-21 13:14:50 UTC
Permalink
Post by rjagathe
Hi,
when I run the maco, the second line throws an error message "user-
defined type not defined"
Please help.
-rjagathe
Add a reference to the Microsoft Outlook Object library in the vba editor's
Tools > References
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
rjagathe
2010-02-22 14:31:59 UTC
Permalink
Hi,
 >when I run the maco, the second line throws an error message "user-
defined  type not defined"
Please help.
-rjagathe
Add a reference to the Microsoft Outlook Object library in the vba editor's
Tools > References
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor -  Word MVP
My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Hi,
Even then it throws the same error message.

-rjagathe
Graham Mayor
2010-02-22 14:53:18 UTC
Permalink
Have you set the reference in the Word template in which the macro is
stored? The error message is present because the macro uses the Microsoft
Outlook object library called by the line

Dim ol As New Outlook.Application

If that object library is not available, the user-defined type not defined"
message will occur.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Post by Graham Mayor
Post by rjagathe
Hi,
when I run the maco, the second line throws an error message "user-
defined type not defined"
Please help.
-rjagathe
Add a reference to the Microsoft Outlook Object library in the vba editor's
Tools > References
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Hi,
Even then it throws the same error message.

-rjagathe
Graham Mayor
2010-02-22 15:01:24 UTC
Permalink
Incidentally the Excel version would be as follows - and that too requires a
reference to Outlook.

Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strDocPath As String
Dim strDocName As String

strDate = DateAdd("m", 1, Date)
strDate = DateAdd("d", 15, strDate)
With ActiveWorkbook
On Error GoTo CancelledByUser
.Save
strDocPath = .FullName
strDocName = .Name
End With
Set ci = ol.CreateItem(olAppointmentItem)
With ci
.Start = strDate
.ReminderSet = True
.AllDayEvent = True
.Subject = strDocName
.Categories = "Excel Documents"
.Body = strDocPath & " requires processing."
.BusyStatus = olFree
.Save
End With
Set ol = Nothing
Exit Sub
CancelledByUser: 'Error handler
MsgBox "Cancelled By User", , "Operation Cancelled"
End Sub
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Post by Graham Mayor
Post by rjagathe
Hi,
when I run the maco, the second line throws an error message "user-
defined type not defined"
Please help.
-rjagathe
Add a reference to the Microsoft Outlook Object library in the vba editor's
Tools > References
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
My web sitewww.gmayor.com
Word MVP web sitehttp://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Hi,
Even then it throws the same error message.

-rjagathe
Loading...