Advertisement
Guest User

Untitled

a guest
Mar 26th, 2019
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. Sub addTextForBooks()
  2. '
  3. ' addTextForBooks 巨集
  4. '
  5. '
  6. Dim shp As Shape
  7. For Each shp In ActiveDocument.Shapes
  8. Dim countStr As Integer
  9. Debug.Print shp.ZOrderPosition
  10. shp.Select
  11. If shp.TextFrame.HasText = -1 Then
  12. If shp.TextFrame.TextRange.Words.Count > 1 Then
  13. shp.TextFrame.AutoSize = -1
  14. shp.TextFrame.TextRange.InsertAfter Chr(13) & "上字"
  15. countStr = shp.TextFrame.TextRange.Characters.Count
  16. shp.TextFrame.TextRange.Characters.Item(countStr - 2).HighlightColorIndex = wdBrightGreen
  17. shp.TextFrame.TextRange.Characters.Item(countStr - 1).HighlightColorIndex = wdBrightGreen
  18. End If
  19. End If
  20. Next
  21. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement