Author Topic: IDs of shapes created by shape operations  (Read 3619 times)

0 Members and 1 Guest are viewing this topic.

Yacine

  • Hero Member
  • *****
  • Posts: 2991
IDs of shapes created by shape operations
« on: June 11, 2010, 12:51:48 AM »
How do I get the IDs of newly created shapes (in a macro) by shape operations like join, combine, trim, etc.

The fragment method is for example described by MS as follows:
Quote
Breaks selected shapes into smaller shapes.
expression.Fragment

expression   A variable that represents a Selection object.

Return Value Nothing

Remarks
Using the Fragment method is equivalent to clicking Fragment on the Operations submenu of the Shape menu. The produced shapes are the topmost shapes in the containing shape of the selected shapes. They inherit the formatting of the first selected shape and have no text.

The original shapes are deleted and there aren't any shapes selected when the operation is complete.
Comparing the new page's list of shapes with the previous one does not seem to me the right solution.

any help is highly appreciated.
Yacine

JuneTheSecond

  • Hero Member
  • *****
  • Posts: 1027
    • Visio Shapes, Stencils and Sample Drawings
Re: IDs of shapes created by shape operations
« Reply #1 on: June 11, 2010, 03:40:45 AM »
One of the ways is to use ShapeAdded events.
Decide the information, user defined cell ,shape data or shape name,
to give the new shapes before each operation.
Give the decided information to the newly added shapes in the ShapeAdded events.
« Last Edit: June 11, 2010, 06:46:13 AM by JuneTheSecond »
Best Regards,

Junichi Yoda
http://june.minibird.jp/

Yacine

  • Hero Member
  • *****
  • Posts: 2991
Re: IDs of shapes created by shape operations
« Reply #2 on: June 14, 2010, 12:26:16 AM »
Worked perfectly. Thank you very much.
Yacine