Hi, I've been trying to get this part working for a long time it just doesn't seem to work as expected.
This is what I need to get done using aspose.slides:
I need to be able to attach any file to a powerpoint slide as an icon. When the user opens the document he should be able to click the icon and save the file.
It is possible to do this from powerpoint (office 2003) by Insert -> Object -> From file -> choose file and check "Show as icon" with any file including files without extension. It seems like powerpoint does not need to support the OLE type when doing this and opens the file in the right application using the associated file extension.
I've read all posts in this forum on this subject and none seems to work well:
1. I've tried to replace the data inside an PDF document I attached in powerpoint with another PDF document, this seems to work. Since I need to be able to add multiple PDF documents I tried to clone the attached file but this does not work. When I serialize the OleObjectFrame shape and then add the shape I get an PictureFrame and not an OleObjectFrame. This PictureFrame can't be casted or converted to a OleObjectFrame so I can't replace the data. This is a quite bad solution even if it works since I need to add shapes for all file types that the user should be able to attach.
2. I've tried to add the files using the AddOleObjectFrame using the approach you recommend in the thread:
<A href="https://forum.aspose.com/t/104650</A></P>
<P>When I do this pdf files does not work and when I try to click on the files in powerpoint I get the message : "An unknown error occured or the server program can not be found. You might have to reinstall the server program". Adding an image as Imager will not work either and gives me the same error message. I've tried to add MS Excel and MS Word files using a similar approach but by setting the ObjectType to the corresponding values and this works just fine.
I've also tried to set the properties of the OleObjectFrame after adding an PDF to make sure it has the exact same properties:
ObjectIsIcon true bool
ObjectIsLink false bool
ObjectName "Acrobat Document" string
ObjectProgId "AcroExch.Document.7" string
ObjectType Unknown Aspose.Slides.OleObjectType
This still does not work and gives me the same error. I've attached the new.pdf file to this thread.
Me and larsxe has been trying to work around this problem for months now (see his posts in the forums) without any good solution/answer from you guys. Is it possible for you to fix this? If you can fix it, can you also please attach a working code example on what ObjectName to use when calling the AddOleObjectFrame method for the following formats or any code on how to attach the following files (its important that the attached files has ObjectIsIcon = true):
.gif
.jpg
.png
.txt
.pdf
When you provide a solution, please attach sample files (.pdf, .txt, .gif, .jpg, .png) as well so we can debug here in case it still does not work on our machines.
Note:
We're using Office 2003, Visual Studio 2005 (2.0.50727 SP1 .NET Framework).
Regards
Jesper