Slides OLE Object Frame resize issue

Hi,

I am trying to embeed a XLS file in to the presentation using OLEObjectFrame. but it is not fitting in to the body portion of the slide, is there any other way where i can place a placeholder and then replace with that with the original file.

thanks & regards,

justin

Hello Justin,

There are actually two sizes.

1- Size of OLE Object
2- Size of OLE Object Frame

You cannot control the 1st size, but you can control the 2nd size.

In the attached source.ppt, there is an OLE object in the form of Excel Sheet which is getting out of slide boundaries.

Although, as said in point number 1, you cannot control, how many columns or rows of Excel Sheet should be displayed, but you can bring this Excel Sheet inside the slide boundary by reducing the width of Ole Object Frame as shown in the following code.

Please see the source.ppt and output.ppt.

Presentation pres = new Presentation("c:\\source.ppt");
Slide sld = pres.GetSlideByPosition(1);

//You can control OleObjectFrame Size
OleObjectFrame oof = sld.Shapes[0] as OleObjectFrame;
oof.Width = oof.Width - 1000; //Decrease width

//Write presentation on disk
pres.Write("c:\\output.ppt");