Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7703869
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:33:26+00:00 2026-05-31T23:33:26+00:00

Quick question hopefully someone can help out here. I’m trying to copy and paste

  • 0

Quick question hopefully someone can help out here. I’m trying to copy and paste slides from one powerpoint presentation to the next. I’ve got it currently so that it will copy and paste all the number of slides over to the correct one, but my problem is it is only pasting over the last slide of the presentation over and over. I’ve tried both for/foreach loops, and yet is just give me the one slide, I’m wondering if it isn’t the CommandBars. But I see them being used to reset slides in a for/foreach loop. Any ideas?

    public void AppendPPTX(string newContent)
    {
        int sourceSlideRange = 0;
        int targetSlideRange = Application.ActiveWindow.Presentation.Slides.Count;
        PowerPoint.Presentation target;
        PowerPoint.Presentation source;

        try
        {
            target = Application.ActivePresentation;
            source = Application.Presentations.Open(newContent, Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse);

            sourceSlideRange = source.Slides.Count + 1; //otherwise I was just getting the second to the last slide

            for (int i = 1; i < sourceSlideRange; i++)
            {
                source.Slides[i].Copy();
                target.Slides[targetSlideRange].Select();
                target.Application.CommandBars.ExecuteMso("PasteSourceFormatting");
            }
            source.Close();
        }
        catch (Exception)
        {
            MessageBox.Show("Error opening PowerPoint, corruption found inside the powerpoint file. " +
                            Environment.NewLine + "The corrupted file has been deleted." + Environment.NewLine +
                            "Please attempt to redownload file.",
                            "Error Opening PowerPoint",
                            MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:33:27+00:00Added an answer on May 31, 2026 at 11:33 pm

    Try saving your PPT after PasteSourceFormatting. I did had the same problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a quick and hopefully simple question that I hope someone can help
Ok guys, just a quick question hopefully someone can find my mistake quickly, but
Hopefully a quick question here. Can you use a function's returned value in a
Alright, hopefully someone can help me with this because I'm at a loss here.
Hopefully a quick python question here... import plistlib pl = plistlib.readPlist('/Users/name/Documents/some.plist') print(pl[0]['keyA'] , pl[0]['keyD']
Just a quick question (hopefully). I want to slide one div in front of
Hopefully a very quick question. In one of my functions I want to generate
I have a quick question that hopefully someone has worked through before. In the
Hopefully a quick question. I'm trying to validate a double. Making sure it's positive
Hopefully a quick question, how can I get this to be well formed, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.