Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

How to automatically have a scheduled item update when the task updates in Outlook 2003?

Posted on 2007-04-03
6
Medium Priority
?
189 Views
Last Modified: 2010-04-08
We are looking for a better way to associate Tasks in Outlook 2003 with the Calendar.  We would like it so that when someone updates the time in Tasks, it automatically updates the time of the associated scheduled item in the Calendar.  Thanks
0
Comment
Question by:PCLANTECHS
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 76

Expert Comment

by:David Lee
ID: 18870904
How do we know which item on the calendar is associated with that task?
0
 
LVL 1

Author Comment

by:PCLANTECHS
ID: 18889892
They have the same ticket number prefix
0
 
LVL 76

Expert Comment

by:David Lee
ID: 18916600
Is this information in the subject line of both items?  Also, how long is the ticket numbr prefix and is it alphanumeric?
0
 
LVL 1

Author Comment

by:PCLANTECHS
ID: 18917447
The information is in both the subject lines.  The prefix would be alphanumeric and would include the clients name or business name.  An Example would be "M05_Client Name, "
0
 
LVL 76

Accepted Solution

by:
David Lee earned 2000 total points
ID: 18930528
Got it.  Ok, we can accomplish this with a script like the one below.  This code monitors the Tasks folder watching for items being changed.  When it sees a change it searches the Calendar for a matching item.  If it finds a match, then it updates the appointment.  If it finds more than one match, then it displays an error message.  I tested this code using Outlook 2003 and it worked perfectly.  Follow these instructions to use it.

1.  Start Outlook
2.  Click Tools->Macro->Visual Basic Editor
3.  If not already expanded, expand Microsoft Office Outlook Objects and click on ThisOutlookSession
4.  Copy the code marked as going in ThisOutlookSession and paste it into the right-hand pane of the VB Editor window
5.  Edit the code as needed.  I placed a comment line immediately before each line that needs editing
6.  Click the diskette icon on the toolbar to save the changes
7.  Close the VB Editor
8.  Click Tools->Macro->Security
9.  Set the Security Level to Medium
10.  Close Outlook
11.  Start Outlook
12.  Outlook will display a dialog-box warning that ThisOutlookSession contains macros and asking if you want to allow them to run.  Say yes.  Yoou can avoid having to do this each time by signing the code.  Instructions for doing that are here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnoxpta/html/odc_dsvba.asp


Public WithEvents olkItems As Outlook.Items

Private Sub Application_Quit()
    Set olkItems = Nothing
End Sub

Private Sub Application_Startup()
    Set olkItems = Session.GetDefaultFolder(olFolderTasks).Items
End Sub

Private Sub olkItems_ItemAdd(ByVal Item As Object)
    'Code to process the task item being added
    'We could add code here that would create an appointment each time a task is added
End Sub

Private Sub olkItems_ItemChange(ByVal Item As Object)
    Dim olkCalendar As Outlook.Items, _
        olkMatches As Outlook.Items, _
        olkAppointment As Outlook.AppointmentItem, _
        strKey As String
    Set olkCalendar = Session.GetDefaultFolder(olFolderCalendar).Items
    strKey = Item.Subject
    'This matches on the entire subject line.  If we need to use just a portion of the
    'subject line, then I'll need to know more about the subject line so I can figure a way
    'to extract just the portion we need.
    Set olkMatches = olkCalendar.Restrict("[Subject] = '" & strKey & "'")
    If olkMatches.Count = 1 Then
        Set olkAppointment = olkMatches.Item(1)
        With olkAppointment
            'I'm not clear on how you want the time updated, so this is just an example
            .Start = Item.DueDate
            .Save
        End With
    Else
        MsgBox "The calendar contains more than one appointment that matches the task." & vbCrLf & "Processing aborted.", vbCritical + vbOKOnly, "Update Associated Appointment"
    End If
    Set olkAppointment = Nothing
    Set olkMatches = Nothing
    Set olkCalendar = Nothing
End Sub

Private Sub olkItems_ItemRemove()
    'Code to process the task item being deleted
    'We could add code here that would delete the associated appointment
End Sub
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Many people use more than one email account and so it becomes difficult for them to manage them when they use separate accounts,  so, in this article, I have shared an easy way to add Other Mail Accounts in your Google Inbox. It helps to combine all…
Changing a few Outlook Options can help keep you organized!
Many of my clients call in with monstrous Gmail overloading issues with Outlook. A quick tip is to turn off the All Mail and Important folders from synching. Here is a quick video I made to show you how to turn off these and other folders in Gmail s…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

609 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question