Hi,
i would like to insert a word document into a slide, is this possible?
Hi,
i would like to insert a word document into a slide, is this possible?
Dear Adam,
Yes, try this code.
//Read the MS-WORD file into the stream
FileStream fin = new FileStream("c:\\sample.doc", FileMode.Open, FileAccess.Read);
byte[] byts = new byte[fin.Length];
fin.Read(byts, 0, (int)fin.Length);
fin.Close();
//Create the presentation and insert the MS-WORD file
Presentation dstPres = new Presentation();
Slide dstSld = dstPres.GetSlideByPosition(1);
OleObjectFrame oof = dstSld.Shapes.AddOleObjectFrame(100, 100, 3000, 3000, "Microsoft Word Document", byts);
//Write the presentation on disk
dstPres.Write(@"c:\destination.ppt");
great it works, thanks!