Powerpoint 2007

P

Peter B

Hello,

I have developed some applications in VB.NET which create Powerpoint Slides
as reports. Basically it dynamically creates slides and displays a clients
data/report as a powerpoint presentation. It

works fine under Powerpoint 2000, 2002 (XP) and 2003. Now that Microsoft
have released 2007 in Beta, I thought I would grab the opportunity to run my
software with Office 2007 installed on the machine.

Basically it fails in a few areas, and I was wondering if anyone knows if
maybe the errors I am getting is due to the fact that 2007 is still in Beta
and Microsoft have not finished the Powerpoint Object

Model as yet. The error I am getting suggests this. The code is below for
the first area that is erroring:


Private Sub InitSlide(ByVal Pres As PowerPoint.Presentation, ByVal Title As
String, ByVal iCount As Integer, ByVal iColumns As Integer, ByRef Sld As
PowerPoint.Slide, ByRef Tbl As PowerPoint.Table, ByVal

sAdditionalText As String, ByVal sSubHeading As String, ByVal sSubHeading2
As String)
Dim Shp As PowerPoint.Shape
Dim Shp2 As PowerPoint.Shape
Dim sngWidthCellBase As Single
Dim siTop As Single = 100

'Const iLEFT As Integer = 48

Sld = AddSlide(Pres, Sld)

DoInitSlide(Sld, Title)

If sSubHeading.Length > 0 Then
siTop = AddSubHeading(Sld, sSubHeading, siTop) '+ 10
End If
If sSubHeading2.Length > 0 Then
siTop = AddSubHeading2(Sld, sSubHeading2, siTop) '+ 10
End If
If sAdditionalText.Length > 0 Then
siTop = AddAdditionalText(Sld, sAdditionalText, siTop) '+ 10
End If

If iCount > 0 Then
Shp2 = Sld.Shapes.AddTable(1, iColumns, iLEFT, siTop,
Sld.Master.Width - (iLEFT * 2), 380)


'The error occurs when trying to set the Forecolor.RGB property.
With Shp2.Line
.ForeColor.RGB = gCOLOR_BLUE_DARK
.Weight = 0
End With

Tbl = Shp2.Table

sngWidthCellBase = Tbl.Columns.Item(1).Width

End If
End Sub

I have put a remark where the error occurs. ie. when trying to set the
Forecolor.RGB property.

The error I am getting is:

<error: an exception of type: {System.ArgumentException} occurred>

Looking at Shp2.Line in the Watch Window, 12 other Properties also receive
that same error, including the Visible property??

Any ideas ??

Also,

When trying to set the text property below,

Dim Tbl As PowerPoint.Table

With Tbl.Rows.Item(1).Cells.Item(1).Shape.TextFrame.TextRange
'Erroring here
.Text = sData
.Font.Bold = Office.MsoTriState.msoTrue
.ParagraphFormat.Alignment =
PowerPoint.PpParagraphAlignment.ppAlignCenter
.Font.Name = gFONT_TAHOMA
.Font.Size = 10

End With

I get the error:

Run-time exception thrown : System.NotImplementedException - Not implemented

As I said, does anyone know if these errors are just because Office 2007 is
still in Beta ? If this is the case, then I do not have to investigate any
further, and just wait till another release has been

released. If not, then I may have to find other ways of doing what 2000,
2002 and 2003 accept.
 
P

Patrick Schmid

Did you make sure to use the Office 2007 object model DLLs? The version
string for the Office core extensibility COM-dll should say 12, as well
as the .net library for ppt should say 12. I would expect that you run
into issues if you use the libraries for Office 11 with Office 12.

Patrick Schmid
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top