|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
我只写了一种(查找底纹并替换),其余两种就没问题了》》》》》》》》》》》》》》》》》
Sub 查找底纹并替换()
Dim d As Document, sr$, x&
Set d = ActiveDocument
With d.Range(0, 0)
.MoveEnd , 1
Do While .End < d.Content.End - 1
If .Font.Shading.Texture = 150 Then
If .Text <> vbCr Or .Text <> vbCr & Chr(7) Then
x = .Start
Do
.Collapse 0
.MoveEnd , 1
Loop Until .Font.Shading.Texture = 0
sr = d.Range(x, .Start).Text
d.Range(x, .Start).Text = "★" & sr & "★"
.Collapse 0
End If
Else
.Move , 1
End If
Loop
End With
End Sub |
|