Link to home
Start Free TrialLog in
Avatar of jqurashi
jqurashi

asked on

Outlook statistics

Hello

I have been asked if it is possible to draw up statistics in Outlook. Here is the question:

The user has given colours to the specific rendezvous in the calendar. They would like to have at the end of the month the total amount of hours for each type of rendez-vous (coloured) in the calendar.

Does someone have a script for this or know where I can find one.

Thanks

James
Avatar of David Lee
David Lee
Flag of United States of America image

Hi, James.

Do you want a printed report on a per person basis or would you like to collect the information fro all staff and produce an aggregate report?  If the latter, do you have Microsoft Access available or another database system available?
Avatar of jqurashi
jqurashi

ASKER

Hello BlueDevil

Thanks for the reply, the object would be a report per person. Now it wouldn't involve more than 2-3 people.
I have MS Access available. I was checking on the forums about scripting butu I am a real novice in this domaine and it would take me forever just to start to comprenhend how it all works. And if it is only for a handful of users well it is really time consuming!

Cheerio
What version of Outlook do the people have who'd be running this?
They have Outlook 2003
James,

Here's a quick and simple version to demonstrate the capability.  Follow these instructions to set up and use this.

Now, add the macro below by following these instructions.

1.  Start Outlook.
2.  Click Tools > Macro > Visual Basic Editor.
3.  If not already expanded, expand Modules and click on Module1.
4.  Copy the code below and paste it into the right-hand pane of the VB Editor.
5.  Click the diskette icon on the toolbar to save the changes.
6.  Close the VB Editor.
7.  Click Tools > Macro > Security.
8.  Change the Security Level setting to Medium.
9.  Run the macro (Tools > Macro > Macros).

Here's how this works.  The macro begins by prompting the user for the month and year they want to report on.  It then finds all appointments on the default calendar that begin in within that month and loops through them adding up the appointment time based on each appointment's label.  Next, it writes the results to an HTML file and finishes up by displaying that file in Internet Explorer.  The code does use the CDO libraries which should have been installed by default when Outlook 2003 was installed.  If the CDO libraries are missing, then the code will fail.  Outlook doesn't expose the label information directly in 2003.  That's why we have to have CDO.  

I wrote and tested this on a computer running Windows XP SP2 and Outlook 2003 SP2.  It worked perfectly.  
Dim objCDO As Object, _
    objMsg As Object, _
    colFields As Object, _
    objField As Object
    
Sub SummarizeAppointments()
    Const SCRIPT_NAME = "Appointment Summary Report"
    Const LABEL_VALUES = "None,Important,Business,Personal,Vacation,Must Attend,Travel Required,Needs Preparation,Birthday,Anniversary,Phone Call"
    Dim olkItems As Outlook.Items, _
        olkAppt As Outlook.AppointmentItem, _
        arrDate As Variant, _
        datStart As Date, _
        datEnd As Date, _
        intIndex As Integer, _
        intTotal As Long, _
        arrCounts(10) As Long, _
        arrLabels As Variant, _
        objFSO As Object, _
        objFile As Object, _
        objIE As Object
    arrDate = Split(InputBox("Enter the month/year to report on in the form mm/yyyy.", SCRIPT_NAME, Month(Date) & "/" & Year(Date)), "/")
    If IsNumeric(arrDate(0)) And IsNumeric(arrDate(1)) Then
        datStart = arrDate(0) & "/01/" & arrDate(1)
        datEnd = DateAdd("m", 1, datStart)
        datEnd = datEnd - Day(datEnd)
        Set objCDO = CreateObject("MAPI.Session")
        objCDO.Logon "", "", False, False
        Set olkItems = Session.GetDefaultFolder(olFolderCalendar).Items.Restrict("[Start] >= """ & datStart & """ AND [Start] <= """ & datEnd & """")
        For Each olkAppt In olkItems
            intIndex = GetApptColorLabel(olkAppt)
            arrCounts(intIndex) = arrCounts(intIndex) + olkAppt.Duration
            intTotal = intotal + arrCounts(intIndex)
        Next
        arrLabels = Split(LABEL_VALUES, ",")
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.CreateTextFile("C:\eeTesting\" & SCRIPT_NAME & ".html")
        objFile.WriteLine "<p>Report for: " & Session.CurrentUser & "<br />Timeframe: " & datStart & " to " & datEnd & "</p>"
        objFile.WriteLine "<table>"
        objFile.WriteLine "  <tr><td>Appt Type</td><td>Time (hours)</td><td>Pct of Total</td></tr>"
        For intIndex = LBound(arrCounts) To UBound(arrCounts)
            objFile.WriteLine "  <tr><td>" & arrLabels(intIndex) & "</td><td align=""right"">" & Format(arrCounts(intIndex) / 60, "#,##0.00") & "</td><td align=""right"">" & Format((arrCounts(intIndex) / intTotal) * 100, "##0.00") & "%" & "</td></tr>"
        Next
        objFile.WriteLine "  <tr><td><b>TOTAL</b></td><td align=""right"">" & Format(intTotal / 60, "#,##0.00") & "</td><td align=""right"">100.00%</td>"
        objFile.WriteLine "</table>"
        objFile.Close
        Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Navigate2 "C:\eeTesting\" & SCRIPT_NAME & ".html"
        Do Until objIE.readyState = 4
            DoEvents
        Loop
        objIE.Visible = True
        objCDO.Logoff
    Else
        MsgBox "The month/year entered is invalid.", vbCritical + vbOKOnly, SCRIPT_NAME
    End If
    Set objMsg = Nothing
    Set colFields = Nothing
    Set objField = Nothing
    Set objCDO = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olkAppt = Nothing
    Set olkItems = Nothing
    Set objIE = Nothing
End Sub
 
Function GetApptColorLabel(olkAppt As Outlook.AppointmentItem) As Integer
    ' adapted from sample code by Randy Byrne
    ' intColor corresponds to the ordinal value of the color label
    ' 1=Important, 2=Business, etc.
    Const CdoPropSetID1 = "0220060000000000C000000000000046"
    Const CdoAppt_Colors = "0x8214"
    On Error Resume Next
    If Not olkAppt.EntryID = "" Then
        Set objMsg = objCDO.GetMessage(olkAppt.EntryID, olkAppt.Parent.StoreID)
        Set colFields = objMsg.Fields
        Set objField = colFields.Item(CdoAppt_Colors, CdoPropSetID1)
        If Not objField Is Nothing Then
            GetApptColorLabel = objField.Value
        End If
    End If
End Function

Open in new window

WOW......thanks, unfortunately I may not be able to test this tomorrow but on Monday I will have a go. I will let you know. Small question, how long did it take you to write this code!?! Crumbs, seems eye boggling to me!

Cheerio

James
James,

No problem on how long it takes to test this.  It probably took 30 - 60 minutes to write/test this.  I canabalized a good bit of the code from other things I've written, so it took less time than if I'd had to do it all from scratch.  Tested it a few times and added a couple of things just to make it look nicer.  
Hello BluedevilFan

I just copied the code then ran it and I have and error '76'

Would this be cause of the exchange server?

thanks a lot

James


untitled.JPG
untitled2.JPG
Change the path specified on that line.  Sorry, I should have put a comment in the code so you'd have known to do that.  The path can be to any folder on your computer.
Hello BlueDevilFan

Ok , I had to modify another line, at least I managed ot understand the debugger, quite useful when it tells you where the problem is! Anyway it churns out a simple but great html sheet of data!

Now all I have to do is rename the titles which the user gave to the categories, I can do this directly in the VB code no?
Yes, you can edit the titles as needed.  They're on line #8 of the code.  There should be 11 of them.  You can also add formatting to the HTML to make the report look nicer.
Hello BlueDevilFan

I have been away the last 2 days. Right I made the adjustments and the program runs smoothly! I was overjoyed, however there is something that bothers me and I do not understand. The 2 printscreens here show you the users calendar for January and the report

There are 4 different types of labels in the calendar

In the second printscreen you will see that only 2 labels have been listed?!?!? The time doesn't seem to register. There are no bugs when launching the program that is what I cannot fathom.

Many thanks

James
untitled.JPG
Appointment-Summary-Report.txt
Hi, James.

We'll need to run a test to find out what's going on.  Here's what I need you to do.

1.  Replace line #32 of the code I posted with this:
     intTotal = intotal + arrCounts(intIndex)

2.  Insert this line of code immediately after line #30 of the code I posted.
     Debug.Print "Label: " & intIndex & vbTab & "Duration: " & olkAppt.Duration

3.  While still in the VB editor run the macro.  

4.  When the macro is finished, look in the "Immediate" pane.  You should see a bunch of lines that look like this:

    Label: x    Duration: y

I need you to copy all of those lines and post them here.
Hi BDF

Thanks for all this, you are a star!

Label: 0    Duration: 30
Label: 0    Duration: 90
Label: 0    Duration: 150
Label: 0    Duration: 120
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 30
Label: 0    Duration: 120
Label: 0    Duration: 210
Label: 0    Duration: 210
Label: 0    Duration: 450
Label: 0    Duration: 150
Label: 0    Duration: 120
Label: 0    Duration: 30
Label: 0    Duration: 60
Label: 0    Duration: 180
Label: 0    Duration: 90
Label: 0    Duration: 30
Label: 0    Duration: 60
Label: 4    Duration: 60
Label: 0    Duration: 90
Label: 0    Duration: 30
Label: 0    Duration: 120
Label: 0    Duration: 90
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 120
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 330
Label: 0    Duration: 210
Label: 0    Duration: 210
Label: 0    Duration: 150
Label: 0    Duration: 90
Label: 0    Duration: 210
Label: 0    Duration: 75
Label: 0    Duration: 30
Label: 0    Duration: 60
Label: 0    Duration: 30
Label: 0    Duration: 1440
Label: 0    Duration: 60
Label: 0    Duration: 120
Label: 0    Duration: 90
Label: 0    Duration: 150
Label: 0    Duration: 150
Label: 0    Duration: 120
Label: 0    Duration: 180
Label: 5    Duration: 120
Label: 0    Duration: 60
Label: 0    Duration: 60
Label: 0    Duration: 270
Label: 0    Duration: 270
Label: 0    Duration: 1440
Label: 0    Duration: 1440
By the way, your instructions are crystal clear, very helpful for me as I am in unknown territory!

:-)

Cheerio, James
Thanks, James!

Hmmm .... all but two of the items are failing to return a label index (the items showing Label: 0).  I'm not sure why that is.  Replace the SummarizeAppointments sub you have with the one below.  Run the macro again and collect/post the output from the Immediate pane.  I've added a couple of more pieces of information to what it'll show to help me figure out what's going on.
Sub SummarizeAppointments()
    Const SCRIPT_NAME = "Appointment Summary Report"
    Const LABEL_VALUES = "None,Important,Business,Personal,Vacation,Must Attend,Travel Required,Needs Preparation,Birthday,Anniversary,Phone Call"
    Dim olkItems As Outlook.Items, _
        olkAppt As Outlook.AppointmentItem, _
        arrDate As Variant, _
        datStart As Date, _
        datEnd As Date, _
        intIndex As Integer, _
        intTotal As Long, _
        arrCounts(10) As Long, _
        arrLabels As Variant, _
        objFSO As Object, _
        objFile As Object, _
        objIE As Object
    arrDate = Split(InputBox("Enter the month/year to report on in the form mm/yyyy.", SCRIPT_NAME, Month(Date) & "/" & Year(Date)), "/")
    If IsNumeric(arrDate(0)) And IsNumeric(arrDate(1)) Then
        datStart = arrDate(0) & "/01/" & arrDate(1)
        datEnd = DateAdd("m", 1, datStart)
        datEnd = datEnd - Day(datEnd)
        Set objCDO = CreateObject("MAPI.Session")
        objCDO.Logon "", "", False, False
        Set olkItems = Session.GetDefaultFolder(olFolderCalendar).Items.Restrict("[Start] >= """ & datStart & """ AND [Start] <= """ & datEnd & """")
        For Each olkAppt In olkItems
            intIndex = GetApptColorLabel(olkAppt)
            Debug.Print "Label: " & intIndex & vbTab & "Duration: " & olkAppt.Duration & vbTab & "Class: " & olkAppt.Class & vbTab & "Subject: " & olkAppt.Subject
            arrCounts(intIndex) = arrCounts(intIndex) + olkAppt.Duration
            intTotal = intTotal + olkAppt.Duration
        Next
        arrLabels = Split(LABEL_VALUES, ",")
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.CreateTextFile("C:\eeTesting\" & SCRIPT_NAME & ".html")
        objFile.WriteLine "<p>Report for: " & Session.CurrentUser & "<br />Timeframe: " & datStart & " to " & datEnd & "</p>"
        objFile.WriteLine "<table>"
        objFile.WriteLine "  <tr><td>Appt Type</td><td>Time (hours)</td><td>Pct of Total</td></tr>"
        For intIndex = LBound(arrCounts) To UBound(arrCounts)
            objFile.WriteLine "  <tr><td>" & arrLabels(intIndex) & "</td><td align=""right"">" & Format(arrCounts(intIndex) / 60, "#,##0.00") & "</td><td align=""right"">" & Format((arrCounts(intIndex) / intTotal) * 100, "##0.00") & "%" & "</td></tr>"
        Next
        objFile.WriteLine "  <tr><td><b>TOTAL</b></td><td align=""right"">" & Format(intTotal / 60, "#,##0.00") & "</td><td align=""right"">100.00%</td>"
        objFile.WriteLine "</table>"
        objFile.Close
        Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Navigate2 "C:\eeTesting\" & SCRIPT_NAME & ".html"
        Do Until objIE.readyState = 4
            DoEvents
        Loop
        objIE.Visible = True
        objCDO.Logoff
    Else
        MsgBox "The month/year entered is invalid.", vbCritical + vbOKOnly, SCRIPT_NAME
    End If
    Set objMsg = Nothing
    Set colFields = Nothing
    Set objField = Nothing
    Set objCDO = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olkAppt = Nothing
    Set olkItems = Nothing
    Set objIE = Nothing
End Sub

Open in new window

Hello BDF

Right, inserted the code and had an error message regarding the GetApptColorLabel. So I looked up the help on VB and also asked around here and found someone who does a bit of coding. Now he added a few lines from the internet, I will post them, then we launched the macro adn a lot mor data came through. But strangely enough the same 2 labels are only listed.
Dim objCDO As Object, _
    objMsg As Object, _
    colFields As Object, _
    objField As Object
    
Sub SummarizeAppointments()
    Const SCRIPT_NAME = "Appointment Summary Report"
    Const LABEL_VALUES = "None,Important,Business,Personal,Vacation,Must Attend,Travel Required,Needs Preparation,Birthday,Anniversary,Phone Call"
    Dim olkItems As Outlook.Items, _
        olkAppt As Outlook.AppointmentItem, _
        arrDate As Variant, _
        datStart As Date, _
        datEnd As Date, _
        intIndex As Integer, _
        intTotal As Long, _
        arrCounts(10) As Long, _
        arrLabels As Variant, _
        objFSO As Object, _
        objFile As Object, _
        objIE As Object
    arrDate = Split(InputBox("Enter the month/year to report on in the form mm/yyyy.", SCRIPT_NAME, Month(Date) & "/" & Year(Date)), "/")
    If IsNumeric(arrDate(0)) And IsNumeric(arrDate(1)) Then
        datStart = arrDate(0) & "/01/" & arrDate(1)
        datEnd = DateAdd("m", 1, datStart)
        datEnd = datEnd - Day(datEnd)
        Set objCDO = CreateObject("MAPI.Session")
        objCDO.Logon "", "", False, False
        Set olkItems = Session.GetDefaultFolder(olFolderCalendar).Items.Restrict("[Start] >= """ & datStart & """ AND [Start] <= """ & datEnd & """")
        For Each olkAppt In olkItems
            intIndex = GetApptColorLabel(olkAppt)
            Debug.Print "Label: " & intIndex & vbTab & "Duration: " & olkAppt.Duration & vbTab & "Class: " & olkAppt.Class & vbTab & "Subject: " & olkAppt.Subject
            arrCounts(intIndex) = arrCounts(intIndex) + olkAppt.Duration
            intTotal = intTotal + olkAppt.Duration
        Next
        arrLabels = Split(LABEL_VALUES, ",")
        Set objFSO = CreateObject("Scripting.FileSystemObject")
        Set objFile = objFSO.CreateTextFile("C:\Data\" & SCRIPT_NAME & ".html")
        objFile.WriteLine "<p>Report for: " & Session.CurrentUser & "<br />Timeframe: " & datStart & " to " & datEnd & "</p>"
        objFile.WriteLine "<table>"
        objFile.WriteLine "  <tr><td>Appt Type</td><td>Time (hours)</td><td>Pct of Total</td></tr>"
        For intIndex = LBound(arrCounts) To UBound(arrCounts)
            objFile.WriteLine "  <tr><td>" & arrLabels(intIndex) & "</td><td align=""right"">" & Format(arrCounts(intIndex) / 60, "#,##0.00") & "</td><td align=""right"">" & Format((arrCounts(intIndex) / intTotal) * 100, "##0.00") & "%" & "</td></tr>"
        Next
        objFile.WriteLine "  <tr><td><b>TOTAL</b></td><td align=""right"">" & Format(intTotal / 60, "#,##0.00") & "</td><td align=""right"">100.00%</td>"
        objFile.WriteLine "</table>"
        objFile.Close
        Set objIE = CreateObject("InternetExplorer.Application")
        objIE.Navigate2 "C:\Data\" & SCRIPT_NAME & ".html"
        Do Until objIE.readyState = 4
            DoEvents
        Loop
        objIE.Visible = True
        objCDO.Logoff
    Else
        MsgBox "The month/year entered is invalid.", vbCritical + vbOKOnly, SCRIPT_NAME
    End If
    Set objMsg = Nothing
    Set colFields = Nothing
    Set objField = Nothing
    Set objCDO = Nothing
    Set objFile = Nothing
    Set objFSO = Nothing
    Set olkAppt = Nothing
    Set olkItems = Nothing
    Set objIE = Nothing
End Sub
 
Function GetApptColorLabel(objAppt As Outlook.AppointmentItem) As Integer
On Error Resume Next
' Requires reference to CDO 1.21 Library
' Adapted from sample code by Randy Byrne posted on www.OutlookCode.com
' link: http://www.outlookcode.com/codedetail.aspx?id=139
 
' intColor corresponds to the ordinal value of the color label
'1=Important, 2=Business, etc.
Const CdoPropSetID1 = "0220060000000000C000000000000046"
Const CdoAppt_Colors = "0x8214"
Dim objCDO As Object 'As MAPI.Session
Dim objField As Object 'As MAPI.Field
Set objCDO = CreateObject("MAPI.Session")
Set objField = CreateObject("MAPI.Field")
' Create implicit CDO object
With CreateObject("MAPI.Session")
.Logon "", "", False, False
If Len(Trim$(objAppt.EntryID)) > 0 Then
With .GetMessage(objAppt.EntryID, objAppt.Parent.StoreID)
Set objField = .Fields.Item(CdoAppt_Colors, CdoPropSetID1)
If objField Is Nothing Then
Err.Clear
MsgBox "Error processing appt " & objAppt.Subject, vbCritical, "Appt Label Error"
GetApptColorLabel = 0
Else
GetApptColorLabel = objField.Value
End If
End With
End If
.Logoff
End With
Set objField = Nothing
On Error GoTo 0
End Function 'GetApptColorLabel

Open in new window

Now when I run the code this is the data that I get:

Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 60    Class: 26   Subject: commandes
Label: 0    Duration: 60    Class: 26   Subject: Lunch Raphael
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: Suivi de réunion
Label: 0    Duration: 120   Class: 26   Subject: factures
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: Validation cale 3154
Label: 0    Duration: 30    Class: 26   Subject: Amélioration procédure acte d'achat
Label: 0    Duration: 120   Class: 26   Subject: Commandes, ajustement poids sku, mails
Label: 0    Duration: 90    Class: 26   Subject: Commandes
Label: 0    Duration: 60    Class: 26   Subject: facture
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:30
Label: 0    Duration: 60    Class: 26   Subject: Photocopie des commandes
Label: 0    Duration: 50    Class: 26   Subject: Admin / cdes, copies
Label: 0    Duration: 30    Class: 26   Subject: 5039 / biscuits  /crèmes / Gobelets cartons
Label: 0    Duration: 30    Class: 26   Subject: 1:00 / TL 4:15
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 90    Class: 26   Subject: Création SKU
Label: 0    Duration: 150   Class: 26   Subject: SCM - ajustement qty pour budget 2008 Marvinpac
Label: 0    Duration: 120   Class: 26   Subject: facures
Label: 0    Duration: 30    Class: 26   Subject: PDG
Label: 0    Duration: 30    Class: 26   Subject: Transformation Discovery box
Label: 0    Duration: 60    Class: 26   Subject: processus factures paiements Marvinpac => NNSA
Label: 0    Duration: 60    Class: 26   Subject: PDG
Label: 0    Duration: 60    Class: 26   Subject: Factures
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 30    Class: 26   Subject: -0:15
Label: 0    Duration: 30    Class: 26   Subject: 1:00
Label: 0    Duration: 30    Class: 26   Subject: 2:45 / TL 3:15
Label: 0    Duration: 30    Class: 26   Subject: 1:00
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 1:45
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:45
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 30    Class: 26   Subject: 0:30
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 120   Class: 26   Subject: Analyser mon temps
Label: 0    Duration: 210   Class: 26   Subject: Commandes
Label: 0    Duration: 210   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 450   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 150   Class: 26   Subject: Café, transfert, maquant, inversion !!
Label: 0    Duration: 120   Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: 3181 - qty starting kit, donc levier de négo +important pour le 3181
Label: 0    Duration: 60    Class: 26   Subject: 5708 - Module de rangement
Label: 0    Duration: 180   Class: 26   Subject: Tableau QTY cdée Vs OP
Label: 0    Duration: 90    Class: 26   Subject: Lunch Roberto
Label: 0    Duration: 30    Class: 26   Subject: Tél de Virigina Amaretti
Label: 0    Duration: 60    Class: 26   Subject: Commandes 2008 marvnipac avec mes initiales !!
Label: 4    Duration: 60    Class: 26   Subject: factures
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: T.A
Label: 0    Duration: 120   Class: 26   Subject: Updated: Revue de performance
Label: 0    Duration: 90    Class: 26   Subject: Tableau prix 2008
Label: 0    Duration: 60    Class: 26   Subject: Retour de Broc
Label: 0    Duration: 60    Class: 26   Subject: Trajet à Broc
Label: 0    Duration: 60    Class: 26   Subject: Tableau prix/qty 2007
Label: 0    Duration: 120   Class: 26   Subject: Mis(e) à jour: Nespresso Reward pack 2008 - Kick-off Meeting
Label: 0    Duration: 60    Class: 26   Subject: MKL - napkins + boite 5capsules Pro
Label: 0    Duration: 60    Class: 26   Subject: Linda - SCM
Label: 0    Duration: 330   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 210   Class: 26   Subject: Cdes 2008
Label: 0    Duration: 210   Class: 26   Subject: Tableau prix / qty 2007
Label: 0    Duration: 150   Class: 26   Subject: LUNCH Filles
Label: 0    Duration: 90    Class: 26   Subject: Lunch benjamin
Label: 0    Duration: 210   Class: 26   Subject: ASAA
Label: 0    Duration: 75    Class: 26   Subject: Lunch Benoit
Label: 0    Duration: 30    Class: 26   Subject: Organisation Factures
Label: 0    Duration: 60    Class: 26   Subject: Décision Finale Chocolat Reward 2008
Label: 0    Duration: 30    Class: 26   Subject: Sophie Ducroq
Label: 0    Duration: 1440  Class: 26   Subject: Fabienne Chatelan B.Day
Label: 0    Duration: 60    Class: 26   Subject: Designer Zaccheo
Label: 0    Duration: 120   Class: 26   Subject: Lunch
Label: 0    Duration: 90    Class: 26   Subject: Osthéopathe
Label: 0    Duration: 150   Class: 26   Subject: Crème Export avec M. Ruch, Cremo
Label: 0    Duration: 150   Class: 26   Subject: Quality, Ludovica's today email
Label: 0    Duration: 120   Class: 26   Subject: Lunch Ludovica - Caroline
Label: 0    Duration: 180   Class: 26   Subject: Fournisseurs autre que Marvinpac
Label: 5    Duration: 120   Class: 26   Subject: Updated: Accessories' Review Meeting
Label: 0    Duration: 60    Class: 26   Subject: dr kovaliv
Label: 0    Duration: 60    Class: 26   Subject: Préparer procédure café Marvinpac => Orbe
Label: 0    Duration: 270   Class: 26   Subject: Mise à jour tableau évolution des prix
Label: 0    Duration: 270   Class: 26   Subject: Mise à jour tableau évolution des prix
Label: 0    Duration: 1440  Class: 26   Subject: ASAA - Gestion des processus d'achat
Label: 0    Duration: 1440  Class: 26   Subject: ASAA - Gestion des processus d'achat
Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 60    Class: 26   Subject: commandes
Label: 0    Duration: 60    Class: 26   Subject: Lunch Raphael
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: Suivi de réunion
Label: 0    Duration: 120   Class: 26   Subject: factures
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: Validation cale 3154
Label: 0    Duration: 30    Class: 26   Subject: Amélioration procédure acte d'achat
Label: 0    Duration: 120   Class: 26   Subject: Commandes, ajustement poids sku, mails
Label: 0    Duration: 90    Class: 26   Subject: Commandes
Label: 0    Duration: 60    Class: 26   Subject: facture
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:30
Label: 0    Duration: 60    Class: 26   Subject: Photocopie des commandes
Label: 0    Duration: 50    Class: 26   Subject: Admin / cdes, copies
Label: 0    Duration: 30    Class: 26   Subject: 5039 / biscuits  /crèmes / Gobelets cartons
Label: 0    Duration: 30    Class: 26   Subject: 1:00 / TL 4:15
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 90    Class: 26   Subject: Création SKU
Label: 0    Duration: 150   Class: 26   Subject: SCM - ajustement qty pour budget 2008 Marvinpac
Label: 0    Duration: 120   Class: 26   Subject: facures
Label: 0    Duration: 30    Class: 26   Subject: PDG
Label: 0    Duration: 30    Class: 26   Subject: Transformation Discovery box
Label: 0    Duration: 60    Class: 26   Subject: processus factures paiements Marvinpac => NNSA
Label: 0    Duration: 60    Class: 26   Subject: PDG
Label: 0    Duration: 60    Class: 26   Subject: Factures
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 30    Class: 26   Subject: -0:15
Label: 0    Duration: 30    Class: 26   Subject: 1:00
Label: 0    Duration: 30    Class: 26   Subject: 2:45 / TL 3:15
Label: 0    Duration: 30    Class: 26   Subject: 1:00
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 1:45
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:45
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 30    Class: 26   Subject: 0:15
Label: 0    Duration: 30    Class: 26   Subject: 0:30
Label: 0    Duration: 30    Class: 26   Subject: 0
Label: 0    Duration: 120   Class: 26   Subject: Analyser mon temps
Label: 0    Duration: 210   Class: 26   Subject: Commandes
Label: 0    Duration: 210   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 450   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 150   Class: 26   Subject: Café, transfert, maquant, inversion !!
Label: 0    Duration: 120   Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: 3181 - qty starting kit, donc levier de négo +important pour le 3181
Label: 0    Duration: 60    Class: 26   Subject: 5708 - Module de rangement
Label: 0    Duration: 180   Class: 26   Subject: Tableau QTY cdée Vs OP
Label: 0    Duration: 90    Class: 26   Subject: Lunch Roberto
Label: 0    Duration: 30    Class: 26   Subject: Tél de Virigina Amaretti
Label: 0    Duration: 60    Class: 26   Subject: Commandes 2008 marvnipac avec mes initiales !!
Label: 4    Duration: 60    Class: 26   Subject: factures
Label: 0    Duration: 90    Class: 26   Subject: factures
Label: 0    Duration: 30    Class: 26   Subject: T.A
Label: 0    Duration: 120   Class: 26   Subject: Updated: Revue de performance
Label: 0    Duration: 90    Class: 26   Subject: Tableau prix 2008
Label: 0    Duration: 60    Class: 26   Subject: Retour de Broc
Label: 0    Duration: 60    Class: 26   Subject: Trajet à Broc
Label: 0    Duration: 60    Class: 26   Subject: Tableau prix/qty 2007
Label: 0    Duration: 120   Class: 26   Subject: Mis(e) à jour: Nespresso Reward pack 2008 - Kick-off Meeting
Label: 0    Duration: 60    Class: 26   Subject: MKL - napkins + boite 5capsules Pro
Label: 0    Duration: 60    Class: 26   Subject: Linda - SCM
Label: 0    Duration: 330   Class: 26   Subject: Commandes 2008
Label: 0    Duration: 210   Class: 26   Subject: Cdes 2008
Label: 0    Duration: 210   Class: 26   Subject: Tableau prix / qty 2007
Label: 0    Duration: 150   Class: 26   Subject: LUNCH Filles
Label: 0    Duration: 90    Class: 26   Subject: Lunch benjamin
Label: 0    Duration: 210   Class: 26   Subject: ASAA
Label: 0    Duration: 75    Class: 26   Subject: Lunch Benoit
Label: 0    Duration: 30    Class: 26   Subject: Organisation Factures
Label: 0    Duration: 60    Class: 26   Subject: Décision Finale Chocolat Reward 2008
Label: 0    Duration: 30    Class: 26   Subject: Sophie Ducroq
Label: 0    Duration: 1440  Class: 26   Subject: Fabienne Chatelan B.Day
Label: 0    Duration: 60    Class: 26   Subject: Designer Zaccheo
Label: 0    Duration: 120   Class: 26   Subject: Lunch
Label: 0    Duration: 90    Class: 26   Subject: Osthéopathe
Label: 0    Duration: 150   Class: 26   Subject: Crème Export avec M. Ruch, Cremo
Label: 0    Duration: 150   Class: 26   Subject: Quality, Ludovica's today email
Label: 0    Duration: 120   Class: 26   Subject: Lunch Ludovica - Caroline
Label: 0    Duration: 180   Class: 26   Subject: Fournisseurs autre que Marvinpac
Label: 5    Duration: 120   Class: 26   Subject: Updated: Accessories' Review Meeting
Label: 0    Duration: 60    Class: 26   Subject: dr kovaliv
Label: 0    Duration: 60    Class: 26   Subject: Préparer procédure café Marvinpac => Orbe
Label: 0    Duration: 270   Class: 26   Subject: Mise à jour tableau évolution des prix
Label: 0    Duration: 270   Class: 26   Subject: Mise à jour tableau évolution des prix
Label: 0    Duration: 1440  Class: 26   Subject: ASAA - Gestion des processus d'achat
Label: 0    Duration: 1440  Class: 26   Subject: ASAA - Gestion des processus d'achat
It is really weird, as the result is as follows:

Report for: Qurashi Caroline
Timeframe: 01.01.2008 to 31.01.2008

Appt Type Time (hours) Pct of Total
None 196.58 98.50%
Important 0.00 0.00%
Business 0.00 0.00%
Personal 0.00 0.00%
Vacation 1.00 0.50%
Must Attend 2.00 1.00%
Travel Required 0.00 0.00%
Needs Preparation 0.00 0.00%
Birthday 0.00 0.00%
Anniversary 0.00 0.00%
Phone Call 0.00 0.00%
TOTAL 199.58 100.00%


I have also noted something else, when I select this month, the date for the report does NOT change and the data is EXACTLY the same.

Thank you again for all your help, 500 points is not enough in my book, you have already earned way more than that! :-)

Cheerio

James
Hello

Any idea on how to continue?

Cheers
James,

Apologies for being away for so long.  I don't know what's going on here.  I run the code on both my personal and work systems and it works perfectly.  I can't fathom how the code isn't getting the label.  Since everything works here but not there, I have to assume it has something to do with the appointments.  Would it be possible for you to create a PST file and copy ten or so of the appointments to it, then post the PST file in a location where I can download it?  That'd give me the opportunity to see if I can figure out what's happening.
Hello BDF

Eh no worries with Easter around the corner I guessed you must have been away. I have been away as well, Easter holidays and what not. It should be a problem to create a pst folder and then copy to a location (ftp server).

Thanks for everything

Cheerio James
Hi, James.

Post a link to teh file when it's ready and I'll download and test.
hmmm.....okay.....I have never done an upload to an ftp server........I will have a look into this, give me a day or two!

thanks
SOLUTION
Avatar of David Lee
David Lee
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial