|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
本帖最后由 daibao88 于 2018-6-15 15:58 编辑
Sub test()
Dim ph As Paragraph
For Each ph In ActiveDocument.Paragraphs
If ph.OutlineLevel = wdOutlineLevel1 Then
ph.Range.Text = VBA.Replace(ph.Range.Text, Chr(13), "") & "索引" & Chr(13)
End If
Next
End Sub
Sub test()
Dim ph As Paragraph, rg As Range
For Each ph In ActiveDocument.Paragraphs
If ph.OutlineLevel = wdOutlineLevel1 Then
Set rg = ActiveDocument.Range(ph.Range.End - 1, ph.Range.End - 1)
rg.Text = "索引"
End If
Next
End Sub
|
评分
-
1
查看全部评分
-
|