When students don’t come to class
A couple of minor things I have asked my students to do are to read and write Word documents using office automation, and to make use of the Microsoft Agent control. In one lab I combined these, by asking the students to read the contents of a Word document into their application, and then having the Microsoft agent read the file aloud.
I had this exchange on the Cecil discussion forums with a student. I have paraphrased my replies to the student ;-):
Student: What does it mean when I cant import microsoft.office.interop? It has that green error line under the code
Me: Uh, if you'd read the forum at all, I've answered this already. It generally means you were too lazy/stupid to complete the very first step in the process - adding a reference to Word into Visual Studio.
Student: Ive only got Microsoft Word 10.0 library and when i try to add that it says a reference to the libarry already exists. Whats this mean?
Me: It means that you've now figured out step 1. Congratulations. Now, perhaps you should read the error messages that you are getting, they may just give you a clue about what is going wrong.
Student: When I try to run the Lab 10 solution, this is what I get: [Copy paste dump of all 8 build errors]
Me: Ahh, now I get it. You aren't even trying the exercise for yourself but are just trying to run my solution. You actually have to do a little work for yourself (I know, life's a bitch). You have to delete my references to new Office and add in the references to your own office version. You know, like I mentioned in class?
Student: Ok most of it is fine now.... Theres no errors though wen i import microsoft.office.core
Student: Actually the code doesnt work, crashes when i click the read button
Me: It crashes. Crashes. You're 12 weeks into your second programming course, and the most useful diagnostic information you can give is to say that it crashes? What kind of exception was thrown by what line of code and what was the error message? Bloody hell, have you come to class at all this semester?
Student: Oh yep. Well the error was Filenotfoundexception was unhandled and this was the highlighted code: AgentControl.Characters.Load("Peedy", "Peedy.acs")
Me: Riiight. And that's related to Microsoft Office automation how, exactly? Hmm, looks to me like the problem is that it couldn't find the microsoft agent character file. That's probably why it says it's a file not found exception. Strange that. So, maybe you didn't bother with the first step of the Microsoft Agent thing either - you actually have to install it before you can use it. You need to install both the agent engine (msagent.exe) and the peedy character (peedy.exe).
Student: Oh ok how do i go about doing that
Me: What the FUCK? I spent the entire first 10 minutes of the lecture discussion what files to install in what order. It's the very first slide! And I just told you in the previous post! Perhaps if you tried, oh, I dunno, coming to class? Or reading the lecture notes? OK, I'm nice, so I'll make it nice and simple. You...copy...the...files...I...gave...you. You...take...them...home. You...double...click...them. They...install. OK?
Student: Alrighty, thanks for the help