Embedded OLE objects in Power point presentation

Muhammad

Have you released your latest version of the aspose slides with the fix for the embeded office icons included?

regards

Chris Marais

Hi Chris,

The next release is expected this weekend. The icon problem is in the testing phase.

The issues you have found earlier (filed as 11490;11489) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by aspose.notifier.

Muhammad

I am not sure which of my issues have been fixed under your references 11490;11489

I am not sure what I should be testing with your latest release.

1) 205081: Icon issue - I am pretty sure this is one of the issues that is fixed in the release:

2) 205074 : POT Background

3) PDF Files : It will take a longer time as there are many other pending issues.

regards

Hi,

Have you tested POT background when embedded as OLE Object with the latest release. I have tested it with the template you provided in a private post and found that it has been fixed. For icon issue, you will have to provide the correct ObjectProgId and ObjectClassName values for valid results. "Excel.Sheet.8" for MS Excel and "Word.Document.8" for word files.

Hi

I have just tested the latest release it fixes the POT background issue. that is good news.

It does not fix the embedded documnets with icon issue. the excel documnet and word documents do not show icons when embedded

regards

chris

Muhammad

Have you had a chance to check why the embeded icon is not showing for word, excel documents in your latest version 205081: Icon issue.

Do you have any more news on allowing PDF Files to be embedded in power point presentations?

regards

Chris Marais

Hi Chris,

1) The icon issue has been closed because setting ObjectPprogId with appropriate value should show valid icon. It is working on our side with smaller icon that may be interlinked with Ole Objects resize issue which is still under-investigation.

2) Embedding PDF as OLE in ppt is still in investigation phase.

I have downloaded the latest copy of the aspose slides dll and tested the code against embbed excel and word documents.

for word documnets I am setting

oof.ObjectProgId = "Word.Document.8";

Excel documents I am setting

oof.ObjectProgId = "Excel.Sheet.12";

Please could you send me a sample c# project with test word and excel documnets so that I can see the embbeded icon working for word and excel.

Has any progress been made with embbeded PDF files?

regards

Chris

Muhammad

Please could you send me a code sample with an embeded word documnet and excel document with the icon being displayed

regards

Chris

Hi Chris,

Attached 2 ppt files:

template_.ppt - generated by the Aspose.Slides and without changes.

template__.ppt - the same file but opened in MS PowerPoint, and OLE object updated (object menu->change).

There is the code:

[Test]

public void AsposeOLEObject()

{

int iWidth;

int iHeight;

string sInputFile = dataPath + @"\TrackerTest.xls";

string sOutputFile = dataPath + @"\template_.ppt";

FileInfo info = new FileInfo(sInputFile);

//Instantiate a Presentation object that represents a PPT file

Presentation pres = new Presentation(dataPath + @"\template.ppt");

//Accessing a slide using its slide position

Slide slide = pres.GetSlideByPosition(2);

// create an image object, using the filename we just retrieved

System.Drawing.Image image = System.Drawing.Image.FromFile(dataPath + @"\TestImage.jpg");

//Bitmap BitImage = ResizeImage(image, pres.SlideSize.Width/2 , pres.SlideSize.Height /2);

MemoryStream imagestream = new MemoryStream();

image.Save(imagestream, ImageFormat.Bmp);

imagestream.Position = 0;

//get image to use instead of the default Change Object

Picture pic = new Picture(pres, imagestream);

int picId = pres.Pictures.Add(pic);

//Reading excel chart from the excel file and save as an array of bytes

FileStream fstro = new FileStream(sInputFile, FileMode.Open, FileAccess.Read);

byte[] b = new byte[fstro.Length];

fstro.Read(b, 0, (int)fstro.Length);

// size of a slide 10 inch x 7.5 inch

// 576 pixels per inch

// full slide size

iWidth = pres.SlideSize.Width / 2;

iHeight = pres.SlideSize.Height / 2;

//Inserting the excel chart as new OleObjectFrame to a slide

OleObjectFrame oof = slide.Shapes.AddOleObjectFrame(1500,

1100, iWidth, iHeight, "Excel.Sheet.8", b);

string msg = "";

// set the content type if it is known

switch (info.Extension.ToLower())

{

case ".doc":

case ".docx":

oof.ObjectType = OleObjectType.MicrosoftWordTable;

msg = "Please Double click on the image to view the embedded document.";

oof.ObjectProgId = "Word.Document.8";

break;

case ".xls":

case ".xlsx":

oof.ObjectType = OleObjectType.MicrosoftExcel;

msg = "Please double click on the image to view the embedded document.";

oof.ObjectProgId = "Excel.Sheet.8";

break;

case ".ppt":

case ".pptx":

oof.ObjectType = OleObjectType.PowerPointPresentation;

msg = "Please right click on the image and select Presentations Object and Open option.";

break;

case ".pot":

case ".potx":

oof.ObjectType = OleObjectType.PowerPointPresentation;

msg = "Please right Click on the image and select Presentations Object and Open option.";

oof.ObjectProgId = "PowerPoint.Show.8";

break;

default:

oof.ObjectType = OleObjectType.Unknown;

break;

}

//set the icon flag to allow the OLE object to open in new window

oof.ObjectIsIcon = true;

//replace the image that is used for OLE objects

oof.PictureId = picId;

//add message text explaining how the user can access the embedded documents

Rectangle rect = slide.Shapes.AddRectangle(10, 50, 200, 200);

LineFormat lineFormat = rect.LineFormat;

lineFormat.ShowLines = false;

TextFrame textFrame = rect.AddTextFrame(msg);

textFrame.FitShapeToText = true;

//Writing the presentation as a PPT file

pres.Write(sOutputFile);

}

I have tried the code you supplied and I cant replicate the excel icon showing.

I am usng aspose slides version 4.0.1.0 runtime v2.0.50727 is this the correct version to use?

you mentioned below that something might have to be done below to update the object in powerpoint?

"template__.ppt - the same file but opened in MS PowerPoint, and OLE object updated (object menu->change)."

regards

Chris

As I mentioned in my earlier post I still cannot get the embeded icons to work.

I am usng aspose slides version 4.0.1.0 runtime v2.0.50727 is this the correct version to use?

The sample code did not work with the excel and word documents I tried it with.

Please could you advise me where I might be going wrong.

regards

Chris

Hi

Has anymore progress been made with embedding PDF files in powerpoint presentations?

regards

Chris

As I mentioned in my earlier post I still cannot get the embeded icons to work.

I am usng aspose slides version 4.0.1.0 runtime v2.0.50727 is this the correct version to use?

The sample code did not work with the excel and word documents I tried it with.

Please could you advise me where I might be going wrong.

I am also looking for an update on your teams progress with getting embedded PDF files to work with the aspose slides dll

regards

Chris

Hi Chris,

Ref code snippet in ticket 210885, follow the following steps with the output PPT.

1) Open the output PPT in MS PowerPoint 2003.

2) Select the OLE image on slide at position 2.

3) Right click the OLE image and select 'Object Object' --> 'Convert' --> 'OK' to get the icon.

Regarding PDF as OLE Object, it seems it may take a longer time as there are many other high priority tasks although we are committed to resolve PDF as OLE Object issue as well.