none
Append the slides from one presentation to another presentation by iron python RRS feed

  • Question

  • Greeting to All,

    I am working on task to exporting the PPT by using iron python(Microsoft.Office.Interop.PowerPoint packages) from click button on spotfire. Now i have two files names A & B, Ex: file A containing 10 slides & file B containing 10 slides. I want to append(merge) these two files and save it one file name as c. so file should have 20 slides(first 10 slides from file A & second ten slides from B). Can anyone help me how to do that.

    Thanks for your help.

    Manimaran P

    • Moved by Sabah ShariqMVP Friday, April 21, 2017 10:48 AM Moved From Visual C#
    Friday, April 21, 2017 10:34 AM

All replies

  • Hi ManimaranP,

    I am moving your thread to MS Office forum for getting quick response.

    Your understanding and cooperation will be grateful.

    Thanks,
    Sabah Shariq

    [If a post helps to resolve your issue, please click the "Mark as Answer" of that post or click Answered "Vote as helpful" button of that post. By marking a post as Answered or Helpful, you help others find the answer faster. ]

    Friday, April 21, 2017 10:47 AM
  • Hi ManimaranP,

    please refer code below.

    you need to add reference to below.

    using Microsoft.Office.Core;
    using PowerPoint = Microsoft.Office.Interop.PowerPoint;


    code:

    private void button1_Click(object sender, EventArgs e) { var app = new PowerPoint.Application(); var pres = app.Presentations; var file = pres.Open(@"C:\Users\v-padee\Desktop\demo.pptx", MsoTriState.msoTrue, MsoTriState.msoTrue, MsoTriState.msoFalse); file.Slides.InsertFromFile(@"C:\Users\v-padee\Desktop\demo2.pptx",3); file.SaveCopyAs(@"C:\Users\v-padee\Desktop\finalpresentation.pptx", Microsoft.Office.Interop.PowerPoint.PpSaveAsFileType.ppSaveAsPresentation, MsoTriState.msoTrue); }

    Reference:

    Slides.InsertFromFile Method (PowerPoint)

    Regards

    Deepak


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, April 24, 2017 8:26 AM
    Moderator