| vonclausowitz@gmail.com 2006-01-27, 6:56 pm |
| Hi All,
I have a VB appl code to open export Doc files from a powerpoint slide.
The code doesn't work. It opens the first word doc and then stops.
Does anyone know what is wrong with my code?
Function PPT_Export_Docs()
Static ppApp As powerpoint.Application 'Object
Static ppPres As powerpoint.Presentation
Dim arrShapes As Variant
Dim iCount As Integer
ReDim arrShapes(0)
Dim oSh As powerpoint.Shape
Set ppApp = CreateObject("powerpoint.application")
ppApp.Visible = True
For Each oSh In ppApp.ActiveWindow.Selection.SlideRange(1).Shapes
If oSh.Type = 7 Then
arrShapes(iCount) = oSh.Name
iCount = iCount + 1
ReDim Preserve arrShapes(iCount)
End If
Next oSh
For i = 0 To UBound(arrShapes) - 1
ppApp.ActiveWindow.Selection.SlideRange.Shapes(arrShapes(i)).Select
ppApp.ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb Index:=1
ppApp.ActiveWindow.Selection.ShapeRange.OLEFormat.DoVerb
(Word.Dialogs(wdDialogFileSaveAs).Show)
ppApp.ActiveWindow.Selection.Unselect
Next i
End Function
Regards
Marco
|