none
Add image to smart art layout through c#? RRS feed

  • Question

  • I am wondering is there a way to add image to smart art through c#. So for with google search I found how to add text like below

    PowerPoint.Shape shape= oSlide.Shapes.AddSmartArt(oSlide.Application.SmartArtLayouts[3], 10, 125);

    shape.SmartArt.Nodes[1].TextFrame2.TextRange.Text = "check";

    But I am not sure how to include picture

    Tuesday, July 9, 2013 11:32 PM

Answers

  • I think the following emulates the user inserting a picture into a SmartArt node:

    ActivePresentation.Slides(2).Shapes(1).SmartArt.Nodes(2).Shapes(1).Fill.UserPicture "path and file name"


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, July 10, 2013 11:38 AM
    Moderator
  • Thanks Using Fill and UserPicture I was able to add. 

    In C# I modified to have as 

    shape.SmartArt.Nodes[1].Shapes.Item(2).Fill.UserPicture("C...\picute.jpg");

    Wednesday, July 10, 2013 6:47 PM

All replies

  • I think the following emulates the user inserting a picture into a SmartArt node:

    ActivePresentation.Slides(2).Shapes(1).SmartArt.Nodes(2).Shapes(1).Fill.UserPicture "path and file name"


    Cindy Meister, VSTO/Word MVP, my blog

    Wednesday, July 10, 2013 11:38 AM
    Moderator
  • Thanks Using Fill and UserPicture I was able to add. 

    In C# I modified to have as 

    shape.SmartArt.Nodes[1].Shapes.Item(2).Fill.UserPicture("C...\picute.jpg");

    Wednesday, July 10, 2013 6:47 PM