What do you use, VBA or something else?
For both Excel and Word I do an awful lot of VBA scripting. As all of my routines in that world are very specific to Word or Excel, there's no point in extracting that code out to say Lazarus. For my paid work, I'm actually a report writer for various clients, so most of those routines are geared around taking exports from various reporting packages and modifying the format so it meets specific client requirements.
And by leaving those routines in VBA, I can always tweak them on the spot, without needing to break open a compiler.
One more question: Why 2 and 0? What is the logic behind it?
They're just constants. In Lazarus (see below), we would call them enumerated types. The first item is 0, the second 1 and so on.
Type
Position = (poLeft, poRight, poTop, poBottom);
And by using the constants in VBA, your code becomes more readable. And in fact, for exactly that reason, in your code above, instead of using 2 directly, we should have declared a const, then used that...
Const
olContactItem = 2;
....
//Create the new Contact
myContact:=myOlApp.CreateItem(olContactItem);
See for instance:
http://msdn.microsoft.com/en-us/library/office/aa219371(v=office.11).aspx (couldn't find a more up to date list)
and
http://wiki.freepascal.org/Enumerated_types