Quantcast
Channel: General Office Development forum
Viewing all articles
Browse latest Browse all 2257

Creating SmartArt in PowerPoint

$
0
0

Hello Cindy,

I'm having trouble in creating the smartarts for powerpoint, in which the error shows as follows: 

Unhandled Exception: System.Runtime.InteropServices.COMException: Application (unknown member) : Object does not exist.
at Microsoft.Office.Interop.PowerPoint.ApplicationClass.get_SmartArtLayouts()
at ConsoleApplication2.Program.Main(String[] args) in c:\users\jovial\documents\visual studio 2010\Projects\ConsoleAp
plication2\ConsoleApplication2\Program.cs:line 33

I was hoping that you could help me solve this issue. Below shows the code I've done for it.

PowerPoint.Application oPowerPoint = null;
PowerPoint.Presentations oPres = null;
PowerPoint.Presentation oPre = null;
PowerPoint.Slides oSlides = null;
PowerPoint.Slide oSlide = null;
   
oPowerPoint = new PowerPoint.Application();

oPres = oPowerPoint.Presentations;
oPre = oPres.Add(Office.MsoTriState.msoFalse);
oSlides = oPre.Slides;
oSlide = oSlides.Add(1, PowerPoint.PpSlideLayout.ppLayoutText);
Office.SmartArtLayout myLayout = oSlide.Application.SmartArtLayouts[1];

Console.WriteLine(myLayout.Name);

I would really appreciate, if you could support me on this issue.

Thank you. :D


Viewing all articles
Browse latest Browse all 2257

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>