PowerPoint 2002 - Charts disapear when using VisualBasic SaveAs and Export routines!

K

kw

I am developing an application which indexes powerpoint text and publishes
the slides to the web. As part of this process, we convert all slides to
Jpeg. This works fine except when we get to certain bar charts which have
been inserted into powerpoint. These are the charts which use an Excel
datagrid to input data. What we are doing is pretty simple - here is a code
fragment.

###
ppt = Server.CreateObject("PowerPoint.Application")

ppt.Presentations.Open("c:\" & filename,
Microsoft.Office.Core.MsoTriState.msoTrue,
Microsoft.Office.Core.MsoTriState.msoFalse,
Microsoft.Office.Core.MsoTriState.msoFalse)

oPres = ppt.Presentations.Item(1)

oPres.SaveAs(path & image_name, PpSaveAsFileType.ppSaveAsJPG,
Microsoft.Office.Core.MsoTriState.msoTrue)

###

The example above assumes the filename and path are specified as variables.
The result of the last line - oPres.SaveAs is a folder that contains all of
the slides and they all look fine, except the ones that should have charts,
do no.

Has anyone run into this and if so, is there a solution, either by way of
the ususal Microsoft bug patch, or a programming work around? Many Thanks in
advance.
 
K

kw

Right - the chart disappears.

If I do it manually in PPT, it works, so there is a step I am missing.

I got excited when you suggested ungrouping and I ungrouped a chart on my
test file and then ran it through my VB routine and it worked.

HOWEVER, I am having great difficulty figuring out how to ungroup. The
following two different tests never evaluate TRUE even though there is a
Microsoft Chart in the slide. Both of the statements below have been tested
within a loop that iterates through all the shapes on a given slide.

If oShp.Type = Microsoft.Office.Core.MsoShapeType.Group Then

oShp.Ungroup()

End If



If oShp.Type = Microsoft.Office.Core.MsoShapeType.msoChart Then

oShp.Ungroup()

End If



I also tried a few other types such as OLE without success. Anyone have any
ideas out there? THanks in advance.
 
Top