Can I automatically make appointments into tasks also?

D

Duncan McC

A guy posted a Q in the .calendaring NG (see below) - and I'm wondering
now if it can indeed be done (fire off the Save Event - if such a thing
exists)...

Subject: Re: Can I automatically make appointments into tasks also?
From: Duncan McC <[email protected]>
Newsgroups: microsoft.public.outlook.calendaring
Date: Thu, 16 Mar 2006 21:32:49 +1300

I want to have my appointments automatically become a task when I create
them. What I'd really like is to have appointments that contain certain words
("School" or "Call") be saved as both a task and an appointment. I'm
constantly having to drag and drop right now, I'd really like to see if there
is a better way. Thank you.

You could use a wee macro to do this for you - the following macro will
turn the appointment you are on (saved) into a Task...

Sub CreateTaskFromAppointment()
Dim objCurrentItem As Outlook.AppointmentItem
Dim objNewTaskItem As Outlook.TaskItem

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set objNewTaskItem = Outlook.CreateItem(olTaskItem)

objNewTaskItem.Subject = objCurrentItem.Subject
' set more properties...

objNewTaskItem.Save

Set objCurrentItem = Nothing
Set objNewTaskItem = Nothing

End Sub

--
Duncan


[one of his replies, and mine to that]...

Subject: Re: Can I automatically make appointments into tasks also?
From: Duncan McC <[email protected]>
Newsgroups: microsoft.public.outlook.calendaring
Date: Sat, 18 Mar 2006 13:25:58 +1300

Hey Duncan, before I start screwing stuff up trying to create the macro, I
had a few more questions. Is this going to be automatic (create the task when
I click "save and close" a new appointment), or will I need to go in to
macros and run it each time? My second one is a bit trickier, can I have new
tasks created from a new appointment ONLY if I have assigned it a specific
label (the color coding)? For example, create both the appointment and the
task when I select a red label, but just create the appointment when I select
a purple one. Thanks again

I think that can all be coded up - but I'm no expert.

Not sure on triggering off the Save button though (could surely make a
new button that does the same (Save, *and* put in Tasks IF color is set,
etc).

I would post to the vba NG - microsoft.public.outlook.program.vba - and
see if the experts can help you there.
 
K

Ken Slovak - [MVP - Outlook]

If you want to save an item you created using code you call the item's Save
method.




Duncan McC said:
A guy posted a Q in the .calendaring NG (see below) - and I'm wondering
now if it can indeed be done (fire off the Save Event - if such a thing
exists)...

Subject: Re: Can I automatically make appointments into tasks also?
From: Duncan McC <[email protected]>
Newsgroups: microsoft.public.outlook.calendaring
Date: Thu, 16 Mar 2006 21:32:49 +1300

I want to have my appointments automatically become a task when I create
them. What I'd really like is to have appointments that contain certain
words
("School" or "Call") be saved as both a task and an appointment. I'm
constantly having to drag and drop right now, I'd really like to see if
there
is a better way. Thank you.

You could use a wee macro to do this for you - the following macro will
turn the appointment you are on (saved) into a Task...

Sub CreateTaskFromAppointment()
Dim objCurrentItem As Outlook.AppointmentItem
Dim objNewTaskItem As Outlook.TaskItem

Set objCurrentItem = Application.ActiveInspector.CurrentItem
Set objNewTaskItem = Outlook.CreateItem(olTaskItem)

objNewTaskItem.Subject = objCurrentItem.Subject
' set more properties...

objNewTaskItem.Save

Set objCurrentItem = Nothing
Set objNewTaskItem = Nothing

End Sub

--
Duncan


[one of his replies, and mine to that]...

Subject: Re: Can I automatically make appointments into tasks also?
From: Duncan McC <[email protected]>
Newsgroups: microsoft.public.outlook.calendaring
Date: Sat, 18 Mar 2006 13:25:58 +1300

Hey Duncan, before I start screwing stuff up trying to create the macro,
I
had a few more questions. Is this going to be automatic (create the task
when
I click "save and close" a new appointment), or will I need to go in to
macros and run it each time? My second one is a bit trickier, can I have
new
tasks created from a new appointment ONLY if I have assigned it a
specific
label (the color coding)? For example, create both the appointment and
the
task when I select a red label, but just create the appointment when I
select
a purple one. Thanks again

I think that can all be coded up - but I'm no expert.

Not sure on triggering off the Save button though (could surely make a
new button that does the same (Save, *and* put in Tasks IF color is set,
etc).

I would post to the vba NG - microsoft.public.outlook.program.vba - and
see if the experts can help you there.

--
Duncan

So yeah... can this be done? Is there an Event triggered on "Save"? If
not, best other options?
 
D

Duncan McC

If you want to save an item you created using code you call the item's Save
method.

I would like to trigger the code, based on the Save action (keyboard or
mouse) - is this possible?
 

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