For Programmers: Free Programming Magazines  


Home > Archive > Visual Basic > January 2006 > Unable to export doc files from Powerpoint in VB









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Unable to export doc files from Powerpoint in VB
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

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com