|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Public Sub Main()
Dim temp As String, tmpShape As Shape
Dim pptPageCount As Integer, MyFName As String
Dim pptapp As Object, ActivePresentation As Object
Set pptapp = CreateObject("powerpoint.application")
Set ActivePresentation = pptapp.Presentations.Open(ThisWorkbook.Path + "\11月第3周.pptx")
pptPageCount = ActivePresentation.Slides.Count
iii = 1
For j = 1 To pptPageCount
k = ActivePresentation.Slides(j).Shapes.Count
For l = 1 To k
On Error Resume Next
If ActivePresentation.Slides(j).Shapes(l).TextFrame.TextRange.Text <> "" Then
aa = ActivePresentation.Slides(j).Shapes(l).TextFrame.TextRange.Text
bb = Replace(aa, Chr(13), "+")
temp = temp & bb & "+"
aa = ""
End If
On Error GoTo 0
Next l
ReDim Preserve arr1(1 To 1, 1 To iii) '重新声明数组arr1
arr1(1, iii) = temp
temp = ""
iii = iii + 1
Next j
ActivePresentation.Close
pptapp.Quit
End Sub |
|