我對V Basic知之甚少,但我知道我想做的事情一定很簡單。我只想向下一行,到左邊,然後退格,這樣就沒有換行符。我正在嘗試格式化以便可以將其放入 xCode 中。我看過其他人的問題,試圖做類似的事情(重複宏),但總是有一些變數使它不起作用......就像它試圖在文本中找到某些東西一樣。我只想一直往下,bksp,往下bksp,直到最後。
我的文字如下所示:「問題」、「《幽靈》的作者是誰?」、「安德魯達爾保持著什麼世界紀錄?」、「
這是我迄今為止在錄製的巨集中所得到的內容:
' 重新格式化xcode 的問題與答案文字' Selection.MoveDown Unit:=wdLine, Count:=1 Selection.HomeKey Unit:=wdLine Selection.TypeBackspace Selection.MoveDown Unit:=wdLine, Count:=1 Selection.HomeKey Unit: =wdLine選擇.類型退格鍵
請幫忙!感謝!
答案1
嘗試這個:
Sub ElimParas()
With ActiveDocument.Range.Find
.ClearFormatting
.Replacement.ClearFormatting
.Format = False
.Forward = True
.Wrap = wdFindContinue
.Execute FindText:="^p", ReplaceWith:=" ", Replace:=wdReplaceAll
End With
End Sub