CSS 341 - Machine Problem #5
Problem Solving with Arrays
Working with Email
Programs, Word Processors, and Spreadsheets
Due time: November 28, 2009 at midnight
They are back! The Keystone Daily has just awarded us
another contract to develop solutions for their management. The editors at
Keystone Daily want us to deliver a system helping them analyze the emails they
received from their field reporters. Here are the details:
Keystone Daily field reporters send random emails to their
editors whenever they feel happy. The editors read all their emails with
Microsoft Outlook, and save all the emails from the reports in a Microsoft
Outlook Data file (.pst). At the end of each month, the editors go through all
these emails and for each email, the editors need to know:
- Who sent the email
- On what day of the week was the email received (e.g
Monday, or Tuesday, or etc)
- The date and time that the email was received. The editors
are very particular that the month must be spelled out (as in November,
and not 11).
- The subject of the email.
- An alert if a specified character string is contained in
the body of the message.
Finally, the editors want to generate a report where the
above information must be printed out in nice format in a Microsoft Word Document.
This report should sort the emails based on the time of day at which the
emails was received. For example, if two emails arrived one at 14:34:22 on
Monday and another at 9:14:42 on Tuesday, the editors want the ¡§9:14:42 on
Tuesday¡¨ entry to be printed in the report before the one for the ¡§14:34:22
on Monday¡¨. If two emails arrived at the exact same time (hr,
min, sec), the editors do not care which email is printed first.
For example, here is an outlook
data file that contains emails sent by field reporters and here is an
example of the report the editors
want for the top-level directory. Our job is to write a VBScript program to
automate the above routines for the editors. Note that this report
is only for the e-mail messages in the upper level directory or folder
of this data file (the Input directory). There may be several nested
subfolders as well, each with their own e-mail messages. We have seen
in class how to open each of those folders and print out the messages from
them.
The Keystone Daily Chief Financial Officer is disturbed
about the costly information systems contracts that have been issued to
us. In response to his concern, we have negotiated with the Editors a
limited version of the program actually desired (pts 1-4 above). The
Editors are willing to accept a program that only lists the e-mail
messages (in all folders and subfolders) without the alert for the character
string in the body. They hope that the fact that it fails to print out such
alerts will go unnoticed by upper management. But, determined to show
that we ¡§produce more for less,¡¨ we have agreed ¡§under the table¡¨ to try to
meet the actual desired specification (pts 1-5 above), expecting most favored
treatment from the Editors on their next contract.
Here are additional specifications from the editors:
- When our system first starts, it should ask the editor to select
and open an outlook data file (*.pst) containing the emails from the
reporters.
- The program must then process the emails in the top-level
folder in this data file, and sort them according to the received time.
Now, the editors are very particular and insist that we use Microsoft
Excel to perform the sorting operation.
- Our program must then generate a properly formatted
Microsoft Word document that contains the information specified in pts 1-4
above.
- The program must then do this in-turn for each
subdirectory found in the *.pst file, preparing a separately sorted report
for each folder.
- To receive our preferential treatment in the future, the
program should also ask the editor for a character string and add an alert
to the printout for any message that contains this string in its body (pt
5). Note that to accommodate the editors¡¦ typing, the search
should not be case sensitive.
This programming assignment contributes approximately 12.4%
towards your final grade for this course.
Hint:
- Outlook data file (.pst) and the folder contained in the
file may have different names. In this case, you can assume the
file name and the folder name are the same. E.g., if the file name is
FolderOfJunk.pst, you can assume the top-level folder name will be
¡§FolderOfJunk¡¨, if the file name is MyJunk.pst, then you can assume the
folder name is ¡§MyJunk¡¨, etc.
- The VBS Split() function is useful in parsing file
names.
- Bodies of e-mail messages are found as the .Body property
of the MailItem object on outlook.
- You should probably use arrays to store the various
data.
- One way to sort is to sort the indexes of the data fields
and then just rewrite them in the sorted order. (did in class)
- Note that you do not need to report any part of the
message body ¡V just the alert that searchstring was found there.
- Remember from class: The common dialog file opener
works just fine, but the intrinsic FileDialogOpenBox does not work from
Outlook. If you want to use the latter, you need to open excel or
word from your program, then use the FileDialogOpenBox to open your file,
and then close the unwanted excel or word application.
- Finally, it is suggested that you
first get the entire programming working for pts 1-4 above (the upper
level directory), then add the capability of moving through the subfolders,
and finally add the string searching functionality. It would be
much better to meet the contract and fail to get the future preferential
treatment, than to miss the entire deadline trying for pt 5 above. This
recommends a style of software development where it is important to
produce intermediate functional results before the final product.
Intermediate Reports
In order to complete this project on time and correctly,
your team will need to plan meet milestones. Accordingly, I am requiring
the following to be turned in at the MP5 Catalyst drop box at times before the
final product is due. Be sure these preliminary submissions are labeled as
such, so that I do not confuse them with the final products at grading time:
- By noon, Friday, November 20 you are to submit a
document for the team dividing up the overall project into logical tasks
and assign lead responsibility for each of these tasks to one of
the team members. These separate tasks should include the various
software modules you will develop. Conceive the overall project in
terms of these modules and assign responsibility for each. Do not
assign one member overall development responsibility. I want to know
who is taking the lead on each part of the code. As well, there
should be responsibility for integrating the modules together and testing
the integrated package.
- By noon, Wednesday, November 25 you are to deposit
drafts of code segments that the team has developed. Each module is
to indicate who has done primary development on it. The code
segments are to be assembled into one document or vbs file ¡V I don¡¦t want
more than one draft submission, labeled as such. The content will
not influence the grade ¡V your degree of progress may do so, however.