473,396 Members | 2,059 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Add Tasks to Administrator's Outlook on Initial Use

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
May 24 '06 #1
5 2168
Open a module, click Tools, References, and either confirm or add a refernce
to Microsoft Outlook soemversion Library

Run this code

Public Function testaddtask()

Dim ot As Outlook.TaskItem
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 ot = Nothing
Set outapp = Nothing

End Function

You will find a new task in your Outlook tasks.

"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

May 24 '06 #2
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

May 24 '06 #3
Use this line:

Set otasks = outapp.GetNamespace("MAPI").GetDefaultFolder(olFol derTasks)

Instead of

Set otasks = ot.Parent

That way you don't have to already have a task item created in order to get
to the folder.

"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

May 24 '06 #4
Last post in this vein. This one sets Subject , Body , Categories ,
ContactNames , DueDate , Importance , ReminderSet , ReminderTime , StartDate
, and Status.

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.Body = "Do this, please."
ot.Categories = "Category 1; Category 2"
ot.ContactNames = "fred;cwannall;John Smith"
ot.DueDate = DateAdd("d", 3, Date)
ot.Importance = olImportanceHigh
ot.ReminderSet = True
ot.ReminderTime = DateAdd("s", 30, Now)
ot.StartDate = Date
ot.Status = olTaskInProgress
ot.Save
Set otasks = outapp.GetNamespace("MAPI").GetDefaultFolder(olFol derTasks)
For Each ot In otasks.Items
Debug.Print ot.Subject
Next ot
Set otasks = Nothing

Set ot = Nothing
Set outapp = Nothing

End Function

May 24 '06 #5
Thanks, Rick.

I really appreciate it!

Rick Wannall wrote:
Last post in this vein. This one sets Subject , Body , Categories ,
ContactNames , DueDate , Importance , ReminderSet , ReminderTime , StartDate
, and Status.

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.Body = "Do this, please."
ot.Categories = "Category 1; Category 2"
ot.ContactNames = "fred;cwannall;John Smith"
ot.DueDate = DateAdd("d", 3, Date)
ot.Importance = olImportanceHigh
ot.ReminderSet = True
ot.ReminderTime = DateAdd("s", 30, Now)
ot.StartDate = Date
ot.Status = olTaskInProgress
ot.Save
Set otasks = outapp.GetNamespace("MAPI").GetDefaultFolder(olFol derTasks)
For Each ot In otasks.Items
Debug.Print ot.Subject
Next ot
Set otasks = Nothing

Set ot = Nothing
Set outapp = Nothing

End Function


--
Message posted via AccessMonster.com
http://www.accessmonster.com/Uwe/For...ccess/200605/1
May 24 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Kurt | last post by:
Hi We are developing an off-the-shelf software suite for a certain business sector. Most of the program is simply a GUI on top of some .mdb files. Its a .net application written in c# One...
4
by: lauren quantrell | last post by:
Is there a way to open the MS Outlook address book using VBA and then be able to do something with the return value? I want users to click an icon to open the Outlook address book then when an...
1
by: Goran Stjepanovic | last post by:
Hello, Anybody who could point me to some examples on how to include Tasks from Outlook into Windows Forms. I would like to see all my tasks from outlook in my VB.Net application. thanx --...
2
by: Siv | last post by:
Hi, I have written an application which is used by sales staff when discussing products with their customers over the phone. It is a database application that holds detailed information about...
0
by: forbisthemighty | last post by:
A familiar behavior seen in Outlook Web Access is mini-browser windows that pop up telling the user a task is due for completion or an appointment is coming up. I'm looking for ideas on how this is...
4
prabunewindia
by: prabunewindia | last post by:
Hello everybody, here i am going to explain, how to get mails from Outlook express database and store in our own database(local) Initially you have to add the refference Outlook library10.0 or...
3
by: =?Utf-8?B?QWx5?= | last post by:
User (Administrator) was some how deleted but still classed as there, though on login it does not exist. On last Microsoft update came unexpectedly just as I was shutting down as power was due to...
0
by: kkkanoor | last post by:
I am trying to schedule tasks in Windows from my C# program. The tasks get listed in Windows Schedule Tasks list, but it is not getting invoked. It seems I need to give the user name and password to...
2
by: Mamaof3girls | last post by:
Hello--I'm using Outlook. When on "Tasks", my page is set up with "To do List" at the top. I've sorted 'my view' to contain what is important to me. So on my view, it will say "Due Date: Sept. 1,...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.