Apr 132005
 

I have Office 2003, but at work we have Office XP, so my ERP->Outlook project would not run, since it would not find the proper DLL (Microsoft.Office.Interop.Outlook.dll). Now I downloaded the Office XP PIA‘s, and I’ve rebuild the application with these assemblies. The application still works with Office 2003, so I will find out tomorrow if it solved the problem for Office XP.

Update: it works! So the Office 11 .DLL can not be used with Office 10, but the other way around works fine. I would have guessed that backwards compatibility would have taken care of things, but not with MS Office…

 Posted by at 19:55
Apr 122005
 

Yesterday, I corrected a little bug I discovered. When an appointment had several attendees, my program would create multiple entries in Outlook, each with one attendee. I moved a line of code and now things work like they should.

What I want to achieve, is marking the appointments in a non-default color, which you can do in Outlook manually in the New->Appointment dialog. By default Outlook chooses None, but you have Important, Personal, Holiday, etc. The odd thing is, that the “label” (as it is called in the dialog) is not an exposed property of the AppointmentItem you can set.
You need to access Outlook via de MAPI-interface, look for the Calendar-folder, find the item in the Calendar folder, and then change some properties. Very odd, and not very well documented. I spend a great deal of the evening looking for samples how to do it, but so far I have no working code.

 Posted by at 14:59
Apr 122005
 

I still get a lot of search hits from people looking for a way to change the extensions that cannot be viewed in Outlook, because Microsoft decided in all her wisdom to mark a lot of extensions as “unsafe”. In Outlook Express there is a nice dialog to change this behaviour, in Outlook there is not. You can do it by editing the registry by hand, but a lot of people are afraid to do so.

For that reason, I created ouau.exe, or “Outlook Unsafe Attachments Unblocker”. It detects your Office version (which you can override) and lists the extension so you can block/unblock them. There’s a handy “select all” radiobutton that will save you some clicking.

Here is a screenshot.

Click here to download the program. It’s in WinRAR format, so you need to extract it first.

Apr 112005
 

NickMalik has a very nice article about Feature Driven Development (FDD) as opposed to Work Breakdown Structure-development (WBS). A must read (it’s not that long) for every developer and IT-projectmanager out there.

When you think about it: when you develop via the principle “write a test first” (I can’t find the term for it now, brains already in hibernate-mode!), it’s basically FDD. You test a feature, don’t you?

 Posted by at 00:57
Apr 102005
 

My little C# project is coming along just fine. The basic idea is to create a synchronisation tool between an ERP application and Outlook, since the manufacturer of the ERP application has no plans on creating a “synchronize with Outlook” functionality in the near (and not so near) future. Since I don’t want to get into any legal stuff, I wanted to create a one-way sync-mechanism, basically a download-from-ERP-to-Outlook. And since I was in need for some project to learn C# better, this was the opportunity.

Since the ERP application has an ODBC DSN defined on the client to create a connection from MS Word to their data, I decided to use that to connect to the database. ODBC is not the fastest and most elegant thing around, but it’ll do the job just fine.

The main form is just a simple form with a textbox for the employerscode and two datefields, to specify the period that needs to be downloaded to Outlook. The functionality sofar:

– Employee-code is checked against the database
– Timespan is 7 days by default: changing the from-date, the to-date will be 7 days later
– Pressing sync will get all appointments in the daterange, and search for all attendees (other than the employee) of the appointment

What needs to be done to enter the Alpha-stage:
– Convert the found data to an Outlook.AppointmentItem and insert it into Outlook
– Have seperate time-fields (by default 00:00:00 and 23:59:59) to be able to enter a narrow timespan, without the user having to specify the time in each of the date-fields

Things I learned from working with C# (VS.NET 2003) are:
– Case sensitivity. Needs to get used to, and can be very annoying. Odbc is something else than odbc. When the compileroutput lists the error, is sometimes hard to spot what is wrong.
– Functions need not be declared before (above in the sourcecode) you use them. This is different from (object)pascal. But it’s nice: you can keep things together, without the need for a specific order. Alphabetically will do just fine.
– I’m not sure if it can be done in (object)pascal (never tried it), but variables declared within curly brackets have a scope only between these brackets. Very nice for dummy-variables, and you don’t want to make up another name, just because you’re still in the same function/procedure. If it’s a meaningless variable, using the same name is just fine.
– Compiler directives are nice. Having the ability to switch between debug and release with one buttonclick, makes it very usable to include lots of debugmessages, that just won’t show up when you build/run the release-version. No more forgetting about that one ShowMessage when releasing your work to the client.

 Posted by at 01:17
Apr 082005
 

I’ve just been bitten by private declarations. When doubleclicking a component on a form, let’s say a button, you will be given a framework for the code and you can type what you like. In Delphi, you can reference libraries (without having to use the full prefix) that are in the uses-list. In C# you can not. The generated event (button1_Click) is defined as private, which (I have to look it up for the exact scoping) means that you cannot just use the objects/functions that you thought you’d included by “using” them.

Solution (it’s very simple, I know, but one has to learn one step at a time): create a new function, declared as public, and call that function from the event.

 Posted by at 23:36
Apr 072005
 

Yeah! I just created my first add-in for Word. When I press the button on the toolbar, a form comes up that will do the main interaction with the user. Since it’s WRap, the first thing the user will be presented with (for now) is to choose between Design or Run a report.

A nice feature of VS.NET, that I will miss if I buy Visual C#, is the deployment. The wizard created a setup-project in the solution that will install the add-in. I changed some settings to have it correctly installed on my machine, but I have to create a decent (and conditional) setup later. Installing a Word add-in is of no use when you don’t have Word, now is it? With Delphi I used Inno Setup, perhaps that can be used for C# projects as well.

 Posted by at 00:21
Apr 062005
 

Of course, just when I am looking to buy VS.NET (or just Visual C#), Microsoft announces the new VS.NET versions and the new MSDN subscriptions. Grab on to your chair, make sure you can’t fall, and click on this link to view the new options/prices.

What the hell happened? MSDN Universal ($2800) used to cover “everything”, but if you want everything now, you need to shell out $11000 (and $4500 renewal). Geeez. The only thing close in price is VS.NET Pro + MSDN Premium ($2500), but that would mean no team-support whatsoever, as you can see here.

 Posted by at 16:46