J
John Svendsen
Hi All,
I need to extract all texts from PPT presentations to pre-process for
translations.
I've built a macro, but it does not work - can someone please look at it and
hopefully shed some light on what is wrong?
Thanks a lot! JS
--------------------------
Sub ReadText()
'
Dim sFirst As String
Dim sLast As TextRange
Open "c:\abc.txt" For Output As #1
'Print #1, "test"
Do While Not EOF(1)
For Each sld In Application.ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
' MsgBox TextRange.Text
' trying one way...
TextFrame.TextRange.selstart = 0
TextFrame.TextRange.sellength = TextFrame.textlength
TextFrame.TextRange.Copy
sFirst = GetFromClipboard
Print #1, sFirst
' trying another way...
sLast = TextRange.Text
Set sLast = TextFrame.TextRange.Text
sLast = ActiveWindow.Selection.TextRange
Print #1, sLast
End If
Next
Next
Loop
Close #1
End Sub
I need to extract all texts from PPT presentations to pre-process for
translations.
I've built a macro, but it does not work - can someone please look at it and
hopefully shed some light on what is wrong?
Thanks a lot! JS
--------------------------
Sub ReadText()
'
Dim sFirst As String
Dim sLast As TextRange
Open "c:\abc.txt" For Output As #1
'Print #1, "test"
Do While Not EOF(1)
For Each sld In Application.ActivePresentation.Slides
For Each shp In sld.Shapes
If shp.HasTextFrame Then
' MsgBox TextRange.Text
' trying one way...
TextFrame.TextRange.selstart = 0
TextFrame.TextRange.sellength = TextFrame.textlength
TextFrame.TextRange.Copy
sFirst = GetFromClipboard
Print #1, sFirst
' trying another way...
sLast = TextRange.Text
Set sLast = TextFrame.TextRange.Text
sLast = ActiveWindow.Selection.TextRange
Print #1, sLast
End If
Next
Next
Loop
Close #1
End Sub