  because presumably this whole block of code is not called if bcheckdirect false  and that is if and only if  as far as i can see  nelement is endpararpr  so you can as well do if nelement xml endpararpr getad  charunderline 