Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to docs: Grouping Shapes with Shape.Name #1827

Closed
blewjy opened this issue Mar 22, 2019 · 0 comments
Closed

Add to docs: Grouping Shapes with Shape.Name #1827

blewjy opened this issue Mar 22, 2019 · 0 comments
Assignees

Comments

@blewjy
Copy link
Contributor

blewjy commented Mar 22, 2019

When developing new features, we found some difficulty in trying to group a bunch of Shapes together when we only have the reference to the Shape object. Some of the workarounds include trying to loop through all the shapes in the slide, selecting one by one, which is pretty inefficient and results in lengthy code.

A quick and easy way we found is to extract a ShapeRange object from the slide based on the names of the shapes.

string[] names = new string[] { shape1.Name, shape2.Name };
Shape group = this.GetCurrentSlide().Shapes.Range(names).Group();

Will be good to add this into our "Common add-in development traps" document for future contributors to take note!

@blewjy blewjy self-assigned this Mar 22, 2019
ChesterSng added a commit that referenced this issue Apr 3, 2019
…docs

#1827 Add to common traps doc: Grouping shapes with ShapeRange
@blewjy blewjy closed this as completed Apr 7, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant