Controlling Word the Lispy Way
In my last post I asked whether anyone knew how to replace automatically numbered paragraphs in MS Word with their textual (non-auto) equivalents.
No one replied.
So I had to do it myself. Startlingly simple for my humble needs, the solution consists of a key-code invoking a macro which shells out to cscript running a Jscript program. The slightly interesting point is that this last is generated by Parenscript, and looks like so:
(defvar wd-app (*get-object "" "Word.Application"))
(defvar a-doc wd-app.*active-document)
(defun de-number ()
(let ((cnt a-doc.*lists.*count))
(dotimes (i cnt)
(let ((lst (slot-value (a-doc.*lists 1)
'*range.*list-format)))
(lst.*convert-numbers-to-text 3)))))
This is obviously far from being great style, but it gets the job done and has me wondering about all the other things I could be doing with parentheses…