Is there a way to embed an image with the add-in file in PowerPoint 2010 using C# VSTO?

StackOverflow https://stackoverflow.com/questions/23085733

  •  04-07-2023
  •  | 
  •  

I want to put an image file on a custom slide which is being created on the click of a custom button.

As I have applied image icons on the custom button through Resources folder of my application, is there a similar way I can put the image on the slide referencing the Resources folder, so that I need not mention the full path of the image file in the Slide.Shapes.AddPicture() method?

I am using C# VSTO to build the application.

Thanks.

有帮助吗?

解决方案

Did it using the below code:

Image badge = Addin1.Properties.Resources.img; 
String path = Path.Combine(Path.GetTempPath (), "img.png"); 
badge.Save(path);

Remove the image after the image has been pasted on the slide, delete the image from the above path.

File.Delete(path);
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top