Ok, this is messing with my head now.From memory there is a variable you can check in a TPL to detect if your in preview or generation mode.Can I remember what it is, or find it? Like **** I can.I even know someone has written a great answer to this on these forums - it's linked to from at least 2 posts... all written before the version upgrade earlier this year and so now dead. Grrr.Thanks for your help - I know I can work around it by checking iwpt_get_ofile_name but this is going to bug me all week.Cheers