03-18-2017, 03:34 AM
I tried the following method, find and replace the format, the result is a failure :oops:
Macro Macro2
Macro Macro2
;/exe 1
out
typelib Word {00020905-0000-0000-C000-000000000046} 8.0
Word.Application app._getactive ;;connect to Word. Note: need the /exe 1.
Word.Document doc=app.ActiveDocument
str s=doc.Content.Text
;out s
s.findreplace("[13]" "[10]") ;;Word text newlines are [13]
str rx=
;;(?xm)
;;help
ARRAY(POINT) a; int i
if(!findrx(s rx 0 4 a)) end "failed, regular expression"
for i 0 a.len
,VARIANT v1(a[0 i].x) v2(a[0 i].y)
,Word.Range ran=doc.Range(v1 v2)
,ran.Find.Font.Bold=1
,ran.Find.Replacement.Font.Bold=0