Free Support Forum - aspose.com

Aspose.Words table into Aspose.Slides slide

Is there a way to get an Aspose.Words table into an Aspose.Slides presentation? I have tried the following code but get an error. First i get the Object Changed object in PowerPoint, but then double-clicking it gives an error.

After creating a Aspose.Words document called “doc” and creating a table in it:

MemoryStream dstStream = new MemoryStream();
doc.Save(dstStream, SaveFormat.Doc);

Presentation dstPres = new Presentation();
Slide dstSld = dstPres.GetSlideByPosition(1);

byte[] byts = new byte[dstStream.Length];
dstStream.Read(byts, 0, (int)dstStream.Length);
dstStream.Close();
OleObjectFrame oof = dstSld.Shapes.AddOleObjectFrame(100, 100, 3000, 3000, “Microsoft Word Document”, byts);

Response.ContentType = “application/vnd.ms-powerpoint”;
Response.AppendHeader(“Content-Disposition”, “attachment; filename=test.ppt”);
Response.Flush();
System.IO.Stream st = this.Response.OutputStream;
dstPres.Write(st);
Response.End();

Hi,

Please check your word document created through Aspose.Words as a valid word document works perfectly as embedded OLE with Aspose.Slides. I have just tested it with a valid word document having table on it.

Hi,

Please use correct word OLE Server class name "Word.Document.8" instead of "Microsoft Word Document".

<span style=“font-size: 12pt; font-family: “Times New Roman”,“serif”;”>Changing it toWord.Document.8 worked, thanks.

I also had to add this under doc.Save(…):
dstStream.Position = 0;

Hi,

Can you please explain what do you exactly mean as i can not understand you requirement?