Word and Office Outlook Diary - Is it possible to link the two?

G

Guest

Does anyone know whether it is possible to input information in to a word
file and have that automatically update my Microsoft Office Outlook diary?
For example if i had a table in a word document with 14th May and then a note
next to this, it would be able to link in with my diary and input this note
against the 14th May and set up an automatic reminder?
 
G

Graham Mayor

This is fairly straightforward using vba - the basic code is shown below.
You will need to add the Outlook object library to the vba references for it
to work. (vba editor > tools > references)

Sub AddOutlookApptmnt()
Dim ol As New Outlook.Application
Dim ci As AppointmentItem
Dim strDate As Date
Dim strBody As String
strDate = Date
strBody = Selection
Set ci = ol.CreateItem(olAppointmentItem)
ci.Start = strDate
ci.ReminderSet = True
ci.AllDayEvent = True
ci.Subject = "Reminder"
ci.BusyStatus = olFree
ci.Categories = InputBox("Category?")
ci.Body = strBody
ci.BusyStatus = olFree
ci.Save
Set ol = Nothing
End Sub

As you will find, this macro adds an all day diary appointment with the
subject 'Reminder' and the selected text as the body of the entry *at the
current time*.

If you want to use a particular date, then you will need to be able to
identify that date from your document or add an input box (see Categories)
to enter it manually and replace strDate with that date.


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top