CREATING TASKS IN PUBLIC FOLDERS

K

KayVeeW

Hello

I have created a task in Outlook Public Folders from Access, except some of
the fields are not set correctly, namely 'Importance'
.Importance = Medium
or
.Importance = High

Just gives me Importance = Low.

And even though I have a Reminder date the flag is not set and therefore no
reminder is generated. If I manually set the flag then the owner, which can
be different to the one creating the task, this does not work either. During
testing I have set the folder permissions as me being the owner and I created
tasks for myself to rule out permissions etc.

Code:

Set olns = ol.GetNamespace("MAPI")
Set cf = olns.GetDefaultFolder(olPublicFoldersAllPublicFolders)
Set cc = cf.Folders("Customer Service Task")

With cc.Items.Add(olTaskItem)

.Owner = "Victoria Wild" (works)
.Subject = "This is the subject of my task" (works)
.Body = "This is the body of my task." (works)
.ReminderSet = True (don't work)
.StartDate = Now (works)
.DueDate = datCal 'Date from calendar control in form (works)
.Importance = Medium (don't work)
..Save
End With

Any ideas anyone?
 
D

Douglas J. Steele

I'm guessing that you haven't told VBA to ensure that all variables have
been declared, because Low, Medium, High have no meaning unless you've
declared them. (To see whether you have told VBA, see whether there's a line
"Option Explicit" near the top of the module. If not, add it, and go to the
Modules tab under Tools | Options when you're in the VB Editor, and ensure
that the Require Variable Declaration checkbox is checked.)

Outlook has three intrinsic variables defined, olImportanceLow (equal to 0),
olImportanceNormal (equal to 1) and olImportanceHigh (equal to 2). Either
use those intrinsic variables, or defined Low as 0, Medium as 1 and High as
2 in your existing code.
 

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