sojweb, thank you very much!
I tried the first suggestion which works perfectly, but on the other hand creates some redundant code (but I can live with that).
I will have a go at the second one as well and see if I can refine the method a bit (perhaps separate code and content).
Really appreciate your answer, thanks again.