In my previous post, I wasn't sure how to do this, but here is some code
that will add the task and also loop through all the tasks to show you the
existing ones. Presumably, if you use standard text in the Subject you can
test for that and add or not add according to whether or not you find your
task.
I'm not happy about settling for "Dim otasks as object", but it's good
enough to start, and if I find the real object I'll post it. Someone else
probably already knows and will post it here pretty soon. I'd like to know
myself.
Public Function testaddtask()
Dim ot As Outlook.TaskItem
Dim otasks As Object
Dim outapp As Outlook.Application
Set outapp = New Outlook.Application
Set ot = outapp.CreateItem(olTaskItem)
ot.Subject = "Test my new item created at " & Now
ot.Save
Set otasks = ot.Parent
For Each ot In otasks.Items
Debug.Print ot.Subject
Next ot
Set otasks = Nothing
Set ot = Nothing
Set outapp = Nothing
End Function
"rdemyan via AccessMonster.com" <u6836@uwe> wrote in message
news:60bc3d0024024@uwe...
I would like to have my application add administrative tasks to an
Administrator's Outlook Task Folder. I know how to get the User group of
the
CurrentUser and think I can even code how to do the actual additions.
A couple of questions:
1) How do I code it so that it only occurs once - the first time the
administrator opens my app. I think I need code that checks if the tasks
are
already there in Outlook and then aborts if they are.
2) Would it be a good idea to have a menu bar item that will add the tasks
if
the user selects it and regardless of whether the tasks are already in
Outlook or not.
3) How do I set the Recurrence in code. Esp. something like the 4th
Wednesday of a certain month. Just the properties is all I need (ex.
ReminderTime, ReminderSet, etc.)
Thanks.
--
Message posted via http://www.accessmonster.com