on error goto error_handle:
error_handle:
  if err.number=xxxx then 
     msgbox "输入字符串过长",vbokonly,"提示"
  end if