如何用word批量修改txt小说的章节名?
在替换为框中,输入:Extreme Armed Forces &;?
单击全部替换。熟悉word的通配符替换,可以实现很多意想不到的功能。?
第二个问题只有VBA编程才能实现!?
在工具=宏-宏中...,打开一个对话框,新建一个宏,创建,打开VBA编辑器,清空里面的内容,然后粘贴下面的代码,按F5运行。(仅适用于
Sub MyReplace()?
选择。HomeKey?
选择。整个故事?
WholeText = Selection。文字?
调试。打印全文?
WholeTextTmp = " "?
直到WholeText = " "?
MyChTmp = Left(WholeText,1)?
如果InStr("一二三是五六七八九",MyChTmp)那么?
?MyCh = MyCh + MyChTmp?
不然呢?
如果Len(MyCh) = 1那么?
选择案例MyCh?
?案例“一”:MyCh = "001 "?
?案例“二”:MyCh = "002 "?
?案例“三”:MyCh = "003 "?
?案例“四”:MyCh = "004 "?
?案例“五”:MyCh = "005 "?
?案例“六”:MyCh = "006 "?
?案例“七”:MyCh = "007 "?
?案例“八”:MyCh = "008 "?
?案例“九”:MyCh = "009 "?
?案例“十”:MyCh = "010 "?
结束选择?
那么ElseIf Len(MyCh) = 2?
选择案例MyCh?
?案例“二十”:MyCh = "020 "?
?案例“三十”:MyCh = "030 "?
?案例“四十”:MyCh = "040 "?
?案例“五十”:MyCh = "050 "?
?案例“六十”:MyCh = "060 "?
?案例“七十”:MyCh = "070 "?
?案例“八十”:MyCh = "080 "?
?案例“九十”:MyCh = "090 "?
?案例“一百”:MyCh = "100 "?
?案例“十一”:MyCh = "011 "?
?案例“十二”:MyCh = "012 "?
?案例“十三”:MyCh = "013 "?
?案例“14”:MyCh = " 014 "?
?案例“15”:MyCh = " 015 "?
?案例“16”:MyCh = " 016 "?
?案例“十七”:MyCh = "017 "?
?案例“18”:MyCh = " 018 "?
?案例“XIX”:MyCh = " 019 "?
结束选择?
那么ElseIf Len(MyCh) = 3?
选择Case Left(MyCh,1)?
?案例“二”:a = "2 "?
?案例“三”:a = "3 "?
?案例“四”:a = "4 "?
?案例“五”:a = "5 "?
?案例“六”:a = "6 "?
?案例“七”:a = "7 "?
?案例“八”:a = "8 "?
?案例“九”:a = "9 "?
结束选择?
选择Case Right(MyCh,1)?
?案例“一”:b = "1 "?
?案例“二”:b = "2 "?
?案例“三”:b = "3 "?
?案例“四”:b = "4 "?
?案例“五”:b = "5 "?
?案例“六”:b = "6 "?
?案例“七”:b = "7 "?
?案例“八”:b = "8 "?
?案例“九”:b = "9 "?
结束选择?
MyCh = "0" + a + b?
那么ElseIf Len(MyCh) = 4?
选择Case Left(MyCh,1)?
?案例“一”:a = "1 "?
?案例“二”:a = "2 "?
?案例“三”:a = "3 "?
?案例“四”:a = "4 "?
?案例“五”:a = "5 "?
?案例“六”:a = "6 "?
?案例“七”:a = "7 "?
?案例“八”:a = "8 "?
?案例“九”:a = "9 "?
结束选择?
选择Case Right(MyCh,1)?
?案例“一”:b = "1 "?
?案例“二”:b = "2 "?
?案例“三”:b = "3 "?
?案例“四”:b = "4 "?
?案例“五”:b = "5 "?
?案例“六”:b = "6 "?
?案例“七”:b = "7 "?
?案例“八”:b = "8 "?
?案例“九”:b = "9 "?
结束选择?
?MyCh = a + "0" + b?
那么ElseIf Len(MyCh) = 5?
选择Case Left(MyCh,1)?
?案例“一”:a = "1 "?
?案例“二”:a = "2 "?
?案例“三”:a = "3 "?
?案例“四”:a = "4 "?
?案例“五”:a = "5 "?
?案例“六”:a = "6 "?
?案例“七”:a = "7 "?
?案例“八”:a = "8 "?
?案例“九”:a = "9 "?
结束选择?
Select Case Mid(MyCh,3,1)?
?案例“一”:b = "1 "?
?案例“二”:b = "2 "?
?案例“三”:b = "3 "?
?案例“四”:b = "4 "?
?案例“五”:b = "5 "?
?案例“六”:b = "6 "?
?案例“七”:b = "7 "?
?案例“八”:b = "8 "?
?案例“九”:b = "9 "?
结束选择?
选择Case Right(MyCh,1)?
?案例“一”:c = "1 "?
?案例“二”:c = "2 "?
?案例“三”:c = "3 "?
?案例“四”:c = "4 "?
?案例“五”:c = "5 "?
?案例“六”:c = "6 "?
?案例“七”:c = "7 "?
?案例“八”:c = "8 "?
?案例“九”:c = "9 "?
结束选择?
MyCh = a + b + c?
结束如果?
WholeTextTmp = WholeTextTmp+MyCh+MyChTmp?
MyCh = " "?
结束如果?
WholeText = Mid(WholeText,2)?
循环?
选择。整个故事?
选择。Text = WholeTextTmp?
MsgBox "搜索和替换完成!"?
末端接头