from Word to Outlook task

  • Thread starter Thread starter torstein s. johnsen
  • Start date Start date
T

torstein s. johnsen

I want to make a reminder to some of my documents in Word. My plan is to
make a "task" (Hope this is the right word, I'm using an Norwegian Outlook
XP) in Microsoft Outlook with the document.

My wish is a menu item in Word where I can chosse "Send to -- Outlook
task".

Is this possible and how?

I hope the explanation is possible to understand, my computer english is not
very good.

Thanks


Torstein S. Johnsen
 
You can use the Word macro recorder to record a new macro and create a
button that gets whatever information you want from the Word document.
Then the macro would have to be edited to add code similar to the
following (you will need a reference to Outlook set in your Word VBA
project):

Dim oApp As Outlook.Application
Dim oTask As Outlook.TaskItem
Dim oFolder As Outlook.MAPIFolder
Dim oNS As Outlook.NameSpace

Set oApp = CreateObject("Outlook.Application")
Set oNS = oApp.GetNamespace("MAPI")
Set oFolder = oNS.GetDefaultFolder(olFolderTasks)
Set oTask = oFolder.Items.Add
'from here you add information from your document
'the fields you may want to use include Subject, Body, DueDate
With oTask
.Subject = "my document"
.Body = "some text, maybe from Word doc"
.DueDate = DateAdd("d", 1, Date) 'set due for tomorrow
.ReminderSet = True
.ReminderTime = #Feb. 18, 2004 9:00:00 AM#
.Save
End With

Use the Object Browser in the VBA project for the Outlook library to
see what properties are available for use.
 
Back
Top