Welcome NK,

the 'script' you posted in the first post is far away from being executable. Even if the function OUTLOOK() (most probably written functional by Kent) was posted completely (proper closing endselect, endif AND endfunction), it would do nothing as there is NOTHING in it that uses the function. So either you haven't posted your script completely for whatever reason there might be OR you haven't understood the concept of using UDFs.

Please make clear how we can be of help.
Thanx

J.
_________________________