Case sensitive.
(defun c:TEst (/ #Find #Replace)
(vl-load-com)
(and
(setq #Find (getstring T "\nFind what: "))
(setq #Replace (getstring T "\nReplace with: "))
(not (vl-position "" (list #Find #Replace)))
(vlax-for x (vla-get-layouts (vla-get-activedocument (vlax-get-acad-object)))
(vl-catch-all-apply 'vla-put-name (list x (vl-string-subst #Replace #Find (vla-get-name x))))
) ;_ vlax-for
) ;_ and
(princ)
) ;_ defun
Alan, I found this while searching Google. I changed the getstring functions to the text I needed so that it didn't pause for user input and it worked beautifully. I have 261 drawings to convert. I already used Lee's "Batch Find & Replace Text" tool to change text in all 261 drawings which saved us a TON of manual editing time (Lee, thank you so much for that program) but I'd like to change the layout tab to reflect the sheet number change as well. We're simply changing the suffix of each sheet number from DD to CD (Design Documents to Construction Documents).
This isn't really all that important technically because the Layout Tab name doesn't show anything on the sheet so it's really just a preference. I tried a batch lisp from Jeff P Sanders' site but it hangs when there's a proxy graphics notification (FILEDIA and SDI doesn't help). Either way, I was just going to open up about 10 drawings at a time and invoke the raw program that you posted just to speed up the process.
Didn't know if this was ever resolved to run a "batch" text replace for the Layout Tab text. TabSort does the trick but not for multiple DWG files. Thanks in advance guys, and thanks again for these nifty programs. Lee's DEFINITELY saved the day today, holy cow.