Peter Busfield
17th August 2006, 11:22 PM (23:22)
I have written a program in VB.NET that connects to Powerpoint. The below code works when connected to PowerPoint 2000, XP (2002) and 2003, but does not work in 2007. To test this, I have removed all references to older versions of PowerPoint ie 9, 10 and 11, and added a reference to Powerpoint 2007 to force VB to use the version 12 object model. I have stepped through the VB.NET code and have confirmed that the Presentation Object I am using is version 12.
The code is:
Shp2 = Sld.Shapes.AddTable(1, iColumns, iLEFT, siTop, Sld.Master.Width - (iLEFT * 2), 380)
With Shp2.Line
.ForeColor.RGB = gCOLOR_BLUE_DARK
.Weight = 0
End With
The Sld object is declared as a Microsoft.Office.Interop.PowerPoint.Slide
The Shp2 object is declared as a Microsoft.Office.Interop.PowerPoint.Shape
The Sld object has been set to an instance of one of my slides in the current presentation. The AddTable command works fine.
It errors
All I am trying to do is change the Line colour of a table that I have created.
When checking the RGB property in the watch window it says:
<error: an exception of type: {System.ArgumentException} occurred>
Does anyone have any ideas on how to change the Line Colour of a table (ie the border colour of the Table)
Thanks for any help in advance.
--
Regards,
Peter
=== This is an automatically generated message ===
This is my first post. My Welcome thread is here. Please post all my welcome messages there.
=== This is an automatically generated message ===
The code is:
Shp2 = Sld.Shapes.AddTable(1, iColumns, iLEFT, siTop, Sld.Master.Width - (iLEFT * 2), 380)
With Shp2.Line
.ForeColor.RGB = gCOLOR_BLUE_DARK
.Weight = 0
End With
The Sld object is declared as a Microsoft.Office.Interop.PowerPoint.Slide
The Shp2 object is declared as a Microsoft.Office.Interop.PowerPoint.Shape
The Sld object has been set to an instance of one of my slides in the current presentation. The AddTable command works fine.
It errors
All I am trying to do is change the Line colour of a table that I have created.
When checking the RGB property in the watch window it says:
<error: an exception of type: {System.ArgumentException} occurred>
Does anyone have any ideas on how to change the Line Colour of a table (ie the border colour of the Table)
Thanks for any help in advance.
--
Regards,
Peter
=== This is an automatically generated message ===
This is my first post. My Welcome thread is here. Please post all my welcome messages there.
=== This is an automatically generated message ===