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

  • SEARCH
  • Home
  • 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 8389501
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T18:44:40+00:00 2026-06-09T18:44:40+00:00

I developing a PowerPoint 2010 add-in using Visual Studio 2010 and am having significant

  • 0

I developing a PowerPoint 2010 add-in using Visual Studio 2010 and am having significant issues with grouping two objects on a slide. I am trying to create the two objects, place them on the slide and group them all in the same function. Adding the objects and placing them on the slide is not an issue. When it comes to the grouping part though….

I have tried:

PowerPoint._Application myPPT = Globals.ThisAddIn.Application;
PowerPoint.Slide curSlide = myPPT.ActiveWindow.View.Slide;
string[] myRangeArray = new string[2];
myRangeArray[0] =  "nameOfShape0";
myRangeArray[1] = "nameOfShape1";
curSlide.Shapes.Range(myRangeArray).Group();

and

PowerPoint._Application myPPT = Globals.ThisAddIn.Application;
PowerPoint.Slide curSlide = myPPT.ActiveWindow.View.Slide;
curSlide.Shapes.Range(Array("nameOfShape0", "nameOfShape1")).Group();

Both of which fail miserably. I am getting quite frustrated with this and am really hoping some kind soul has a solution for me. Thanks.

Update:
Here is the full code I am using:

PowerPoint._Application myPPT = Globals.ThisAddIn.Application;
PowerPoint.Slide curSlide = myPPT.ActiveWindow.View.Slide;

PowerPoint.Shape browser = curSlide.Shapes.AddOLEObject(110, 70, 500, 400, "Shell.Explorer.2");
var slideName = "webBrowser_0";
browser.Name = slideName;

PowerPoint.Shape rectangle = curSlide.Shapes.AddShape(Microsoft.Office.Core.MsoAutoShapeType.msoShapeRectangle, 110, 70, 500, 400);
rectangle.Name = "shape2";
string[] myRangeArray = new string[2];
myRangeArray[0] = "webBrowser_0";
myRangeArray[1] = "shape2";
curSlide.Shapes.Range(myRangeArray).Group();

The Error I am receiving is “The ShapeRange object must contain at least two items”

  • 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-06-09T18:44:42+00:00Added an answer on June 9, 2026 at 6:44 pm

    Your code worked fine for me. Try this:

    private void ThisAddIn_Startup(object sender, System.EventArgs e) {
        this.Application.PresentationNewSlide += Application_PresentationNewSlide;
    }
    
    void Application_PresentationNewSlide(PowerPoint.Slide Sld) {
        PowerPoint.Shape textBox = Sld.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, 0, 0, 500, 50);
        textBox.Name = "shape1";
        textBox.TextFrame.TextRange.InsertAfter("This text was added by using code.");
    
        textBox = Sld.Shapes.AddTextbox(Office.MsoTextOrientation.msoTextOrientationHorizontal, 0, 100, 500, 50);
        textBox.TextFrame.TextRange.InsertAfter("This text was also added by using code.");
        textBox.Name = "shape2";
    
        PowerPoint._Application myPPT = Globals.ThisAddIn.Application;
        PowerPoint.Slide curSlide = myPPT.ActiveWindow.View.Slide;
        string[] myRangeArray = new string[2];
        myRangeArray[0] = "shape1";
        myRangeArray[1] = "shape2";
        curSlide.Shapes.Range(myRangeArray).Group();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Developing a game with AndEngine GLES2 I am having an issue trying to change
I'm developing a PowerPoint C# VSTO add-in. I want to be able to capture
While developing an application using gwt in ecliplse crashed. Now the server is running
For developing an devices monitor system, I am using a InetAdress isReachable method to
I'm developing an Office 2007 add-in. I would like to have a piece of
Developing a multilingual application in VB.Net 2008, Im able to add resources to forms
I'm developing a tool for exporting slides from a PowerPoint presentation to images and
Developing a simple game for the iPhone, what gives a better performance? Using a
Developing a chrome extension using javascript is one of my university projects. I don't
Developing using MVC-3, Razor, C# Been searching around and cannot find advice I'm looking

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.