G
Graham Mayor
You create calendar entries and reminders in Outllok, not Word; although you
can create an entry from Word using a macro - the basic code being:
Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strTime As String
Dim strDocName As String
Dim intPos As Integer
Dim datOutlookDate As Date
strDate = Date
strTime = Format((Time), "hh:mm")
datOutlookDate = CDate(strDate & " " & strTime)
ActiveDocument.Save
'Find position of extension in filename
strDocName = ActiveDocument.name
intPos = InStrRev(strDocName, ".")
If intPos = 0 Then
End If
strDocName = Left(strDocName, intPos - 1)
Set ci = ol.CreateItem(olAppointmentItem)
With ci
.start = strDate
.ReminderSet = False
.AllDayEvent = True
.Subject = strDocName
.Location = InputBox("Location?")
.Categories = InputBox("Category?")
.Body = InputBox("Body Text?")
.BusyStatus = olFree
.GetRecurrencePattern.RecurrenceType = olRecursMonthly
.Save
End With
Set ol = Nothing
End Sub
You'll also need to set up a reference to the Outlook object library in Word
vba to run the code.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
can create an entry from Word using a macro - the basic code being:
Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As String
Dim strTime As String
Dim strDocName As String
Dim intPos As Integer
Dim datOutlookDate As Date
strDate = Date
strTime = Format((Time), "hh:mm")
datOutlookDate = CDate(strDate & " " & strTime)
ActiveDocument.Save
'Find position of extension in filename
strDocName = ActiveDocument.name
intPos = InStrRev(strDocName, ".")
If intPos = 0 Then
End If
strDocName = Left(strDocName, intPos - 1)
Set ci = ol.CreateItem(olAppointmentItem)
With ci
.start = strDate
.ReminderSet = False
.AllDayEvent = True
.Subject = strDocName
.Location = InputBox("Location?")
.Categories = InputBox("Category?")
.Body = InputBox("Body Text?")
.BusyStatus = olFree
.GetRecurrencePattern.RecurrenceType = olRecursMonthly
.Save
End With
Set ol = Nothing
End Sub
You'll also need to set up a reference to the Outlook object library in Word
vba to run the code.
--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>