Thanks Westley,
Spot on; I translated to c# and it worked a treat. As you said it feels more like writing a 'macro' than working with an OO style API. I guess it is what it is and at least I can think in that mode now I'm aware. Thanks again for your help.
Steve