Here is the one I use
;;; ------------------------------------------------------------------------
;;; BMASK.lsp v1.0
;;;
;;; Copyright © January, 2007
;;; Timothy G. Spangler
;;;
;;; Permission to use, copy, modify, and distribute this software
;;; for any purpose and without fee is hereby granted, provided
;;; that the above copyright notice appears in all copies and
;;; that both that copyright notice and the limited warranty and
;;; restricted rights notice below appear in all supporting
;;; documentation.
;;;
;;; THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT EXPRESS OR IMPLIED
;;; WARRANTY. ALL IMPLIED WARRANTIES OF FITNESS FOR ANY PARTICULAR
;;; PURPOSE AND OF MERCHANTIBILITY ARE HEREBY DISCLAIMED BY THE
;;; PROGRAMMER.
;;;
;;; -----------------------------------------------------------------------
(defun C:BM (/ *error* OldCmdEcho TextObj TextEntList vlText vlFill)
;;; Begin Error Handler -------------------------------------------------
(defun *error* (MSG)
(if (not (member MSG '("Function cancelled" "quit / exit abort")))
(princ (strcat "\n*** Program Error: " (strcase MSG) " ***"))
(princ "\n... Program Cancelled ...")
)
(while (< 0 (getvar "cmdactive"))
(command)
)
(setvar "CMDECHO" OldCmdEcho)
)
;; Set variables
(setq OldCmdEcho (getvar "CMDECHO"))
(setvar "CMDECHO" 0)
;; Load vlisp
(vl-load-com)
;; Select object
(while(null(setq TextObj(car(entsel "\nSelect MTEXT: "))))
(princ " \nNothing Selected...Try Again ")
)
;; Get text entity list
(setq TextEntList (entget TextObj))
;; Check for MTEXT
(if (not (= (cdr (assoc 0 TextEntList)) "MTEXT"))
(progn
(alert "Selected entity is not MTEXT")
;; Reset variables
(setvar "CMDECHO" OldCmdEcho)
;; Restart the program
(C:BM)
)
)
;; Create activeX text
(setq vlText (vlax-ename->vla-object TextObj))
;; Check for background fill
(setq vlFill (vlax-get-property vlText 'backgroundfill))
;; If no background fill exsists
(if (= vlFill :vlax-false)
(progn
;; Set background fill for text
(vlax-put-property vlText 'backgroundfill :vlax-true)
(princ "\n Background fill applied")
)
(progn
;; Set background fill for text
(vlax-put-property vlText 'backgroundfill :vlax-false)
(princ "\n Background fill removed")
)
)
;; Set the draworder to bring text front
(command "draworder" TextObj "" "front")
;; Reset variables
(setvar "CMDECHO" OldCmdEcho)
(princ)
)
;;;
;;; Echos to the command line
(princ "\n BMask v1.0 ©Timothy Spangler, \n January, 2007....loaded.")
(terpri)
(princ "C:BM")
(print)
;;; End echo