|
楼主 |
发表于 2024-9-21 08:19
|
显示全部楼层
- Private Sub SelectRngToSelectText()
- Dim Ppt As New PowerPoint.Application
- Set Ppt = New PowerPoint.Application
- Dim Rng As Range
- Set Rng = Selection
- Dim Sht As Worksheet
- Set Sht = Rng.Parent
- Dim Pres As Presentation
- Dim Sld As Slide
- Dim ShpRng, Shp, Ss As Shape
-
-
- Set ShpRng = Ppt.ActiveWindow.Selection.ShapeRange
- Debug.Print ShpRng.TextEffect.text
- Dim Txt As String
- For ii = 1 To Rng.Rows.Count
- Select Case Rng(ii, 0)
- Case 1 To 10
- Txt = Txt & ChrW(CLng("&H" & 2460 + Rng(ii, 0) - 1)) & Rng(ii, 1) '& vbCr
- Case 11 To 16
- Txt = Txt & ChrW(CLng("&H" & 246 & Chr(65 + Rng(ii, 0) - 11))) & Rng(ii, 1) ' & vbCr
- Case 17 To 20
- Txt = Txt & ChrW(CLng("&H" & 2470 + Rng(ii, 0) - 17)) & Rng(ii, 1) '& vbCr
- End Select
- If ii = Rng.Rows.Count Then
- Txt = Txt
- Else
- Txt = Txt & vbCr
- End If
-
-
- Next ii
- Debug.Print Txt
- With ShpRng
- .TextEffect.text = Trim(Txt)
- '.TextFrame.AutoSize
- End With
- End Sub
复制代码 |
|