|
楼主,并不是水印!只是图形。请试用下面的宏:(粘贴到新建空白文档中,全选,剪切,再粘贴到 VBE 中)
- Sub DeleteShapes()
- '删除图形
- '红色文字提取自图文框/六个星号"*"后面文字提取自文本框/表格环绕将变成图文框
- Dim r As Range, t As Table, iShape As InlineShape, Frm As Frame, n&, m&
- With ActiveDocument
- If .Shapes.Count <> 0 Then .Content.InsertParagraphBefore: m = 1
- Set r = .Paragraphs(1).Range
- '表格取消文字环绕
- For Each t In .Tables
- t.Range.Rows.WrapAroundText = False
- Next
- '删除图片(InlineShape)
- For Each iShape In .InlineShapes
- iShape.Delete
- Next
- '删除图形(Shape)/文本框
- For n = .Shapes.Count To 1 Step -1
- With .Shapes(n)
- If .TextFrame.HasText <> 0 Then r.InsertBefore Text:=.TextFrame.TextRange.Text
- .Delete
- End With
- Next
- '删除图文框(Frame)
- For Each Frm In .Frames
- With Frm
- .Select
- .Delete
- With Selection
- .ClearFormatting
- .Font.Color = wdColorRed
- End With
- End With
- Next
- If m = 1 Then .Content.InsertAfter Text:=vbCr & "******" & vbCr & r.Text: r.Delete
- End With
- Selection.HomeKey 6
-
- End Sub
复制代码 |
|