I personally would do the following, I would make sure I used Lee's routine to get the text from each object, this will ensure symbols and all get exported correctly. Since you already filtered the text with SSGET, you don't need to test to see if each object is still text.
IMPORTANT NOTE: This code will export any mtext formatting as well, there are various threads that discuss how to remove the formatting, so you could utilize one of them.
;----------------------------------------------------------
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;
; Created by Karl E. Sharp
; Date: 6/27/2018
;
; This Program was designed to copy mtext from a dwg
; to csv file for use in excel
;
; Code Modified by: Chris Wade - 06/28/2018
;
;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defun c:MTO (/ elist en fn fname i ss mtxt Filter Ct Obj txt)
;Supporting Functions
;;--------------------=={ Get TextString }==------------------;;
;; ;;
;; Returns the TexString associated with an object, ;;
;; retaining all special symbols. ;;
;;------------------------------------------------------------;;
;; Author: Lee Mac, Copyright © 2010 - www.lee-mac.com ;;
;;------------------------------------------------------------;;
;; Arguments: ;;
;; object - VLA-Object/ename for which to return TextString ;;
;;------------------------------------------------------------;;
;; Returns: TextString associated with object, else nil ;;
;;------------------------------------------------------------;;
(defun LM:GetTextString ( object )
;; © Lee Mac 2010
(
(lambda ( entity / _type elist )
(cond
(
(wcmatch
(setq _type
(cdr
(assoc 0
(setq elist
(entget entity)
)
)
)
)
"TEXT,*DIMENSION"
)
(cdr (assoc 1 elist))
)
(
(eq "MULTILEADER" _type)
(cdr (assoc 304 elist))
)
(
(wcmatch _type "ATTRIB,MTEXT")
(
(lambda ( string )
(mapcar
(function
(lambda ( pair )
(if (member (car pair) '(1 3))
(setq string (strcat string (cdr pair)))
)
)
)
elist
)
string
)
""
)
)
)
)
(if (eq 'VLA-OBJECT (type object))
(vlax-vla-object->ename object)
object
)
)
)
;End of Supporting Functions
(princ "\nSelect text to export:")
(setq Filter '((-4 . "<OR") (0 . "TEXT") (0 . "MTEXT") (-4 . "OR>")))
(if (setq ss (ssget Filter))
(progn
(setq fname (getfiled "Save Text File As:" "" "csv" 1))
(setq fn (open fname "w"))
(if fn
(progn
(setq Ct 0)
(while (< ct (sslength ss))
(setq Obj (vlax-ename->vla-object (ssname ss Ct)))
(if Obj
(progn
(setq txt (LM:GetTextString Obj))
(if txt
(write-line txt fn)
)
)
)
(setq ct (+ ct 1))
)
(princ (strcat "\n* Text file " fname " \n has been created *"))
(close fn)
(startapp (strcat "C:\\Program Files (x86)\\Microsoft Office\\root\\Office16\\EXCEL.exe" " " (chr 34) fname (chr 34)));Make sure you update the path to match where your installation of Excel is or write a routine to find the location of Excel.
)
(princ "\n* Text file was not created.")
)
)
(princ "\n* No text was found to export.")
)
(princ)
)
You could also modify this code fairly easily to work with mleaders. blocks with attributes and while slightly more difficult, you could even add in tables if you wanted to.
You could also change (ssget Filter) to (ssget "_X" Filter) and export all text in the drawing at once.