Hello,
I want to create a PowerPoint presentation that contains a picture. But I want the picture (in the slide) to update when the original file is modified.
I recently get some informations on the forum (Linked PictureFrame example). But in the example, the original object is duplicated from a model. How can I create an linked PictureFrame without using shape serialization from a model ?
Regards,
Stéphane
Hello,
Serialization is used to import the shape (image) from one ppt file into another ppt file. But you are importing it into same presentation, so you are duplicating the object.
If you have already a linked pictureframe inside your ppt file, then you don’t have to use serialization, you simply access it and change its PictureFileName property
Ok, but I want to create a presentation from scratch.
example :
int x = 50;
int y = 50;
int width = 100;
int height = 100;
Presentation ppt = new Presentation();
int picId = ppt.Pictures.Add(new Picture(ppt,@“c:\ppt.png”));
ppt.GetSlideByPosition(1).Shapes.AddPictureFrame(picId, x, y, width, height);
ppt.Write(@“C:\output.ppt”);
But how can I specify that this PictureFrame is linked to the source file ?
Anyone can help me ?
Hello,
Sorry, but there is no way to create linked image from scratch. If possible, try to use template presentation with linked image on a slide.
Ok, Thanks