2023年8月21日 星期一
不囉唆,秒殺課文填充題製作,只要是文字,通都可以,管你是中文、英文、德文、日文還是火星文
直接複製原始碼到VB裡執行,
如果不會操作,請看小弟影片介紹,
如果可以也請按讚訂閱分享,
讓我擁有更多鼓勵可以製作分享更多優良的備課方法及影片。
Copy the source code directly into VB and run it.
If you don't know how to operate, please watch my video introduction.
If possible, please like, subscribe, and share,
so that I can have more encouragement to create and share more excellent lesson preparation methods and videos.
Sub 填充取代()
Dim 查找 As String, 替換 As String, i As Long, n As Long, 詞彙數量 As Long
查找 = InputBox("請輸入要查找的關鍵字,用「、」隔開", "取代")
替換 = InputBox("請輸入要替換的關鍵字,用「、」隔開", "取代")
Dim FindList() As String, ReplaceList() As String
FindList = Split(查找, "、")
ReplaceList = Split(替換, "、")
n = UBound(FindList)
詞彙數量 = n + 1 ' 計算詞彙數量
' 在第二個對話框中需要取代的欄位裡加上符合詞彙數量的下劃線
替換 = String(詞彙數量, "_")
For i = 0 To n
Selection.Find.ClearFormatting
Selection.Find.Replacement.ClearFormatting
With Selection.Find
.Text = FindList(i)
.Replacement.Text = 替換
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWildcards = False
End With
Selection.Find.Execute Replace:=wdReplaceAll
Next i
End Sub
訂閱:
張貼留言 (Atom)
沒有留言:
張貼留言