|
楼主 |
发表于 2018-7-26 10:33
|
显示全部楼层
我是用在ppt上的。
程序如下:
- Sub test2() '替换英文句号,是小数的不替换
- Dim sld As Slide, shp As Shape, txtFrame As TextFrame, txtRange As TextRange
- Dim reg As Object
- For Each sld In ActivePresentation.Slides
- For Each shp In sld.Shapes
- Set txtFrame = shp.TextFrame
- If txtFrame.HasText = True Then
- Set txtRange = txtFrame.TextRange
- If Not txtRange Is Nothing Then
- Set reg = CreateObject("vbscript.regexp")
- With reg
- .Global = True
- .Pattern = "(\D)(\.)"
- txtRange = .Replace(txtRange, "$1。")
- End With
- End If
- End If
- Next
- Next sld
- End Sub
复制代码
再次谢谢。 |
|