Author Topic: Are the items in a Window.Selection object always shapes?  (Read 215 times)

0 Members and 1 Guest are viewing this topic.

Visisthebest

  • Hero Member
  • *****
  • Posts: 640
Are the items in a Window.Selection object always shapes?
« on: June 15, 2022, 04:46:53 AM »
To make sure my code deals with any exceptions I want to understand if there is the possibility that any item in a Window.Selection might be something else than a Visio Shape object.

For instance, Visio users can also use Insert -> Object.

My question is: are those objects always wrapped in a Shape object so a Window.Selection will always contain Shape objects and never any other type?

Is there any other way non-Shape objects can end up as a Window.Selection item?
Visio 2021 Professional

Yacine

  • Hero Member
  • *****
  • Posts: 2984
Re: Are the items in a Window.Selection object always shapes?
« Reply #1 on: June 15, 2022, 04:59:26 AM »
The doc (https://docs.microsoft.com/en-us/office/vba/api/Visio.Selection) says clearly: "Represents a subset of Shape objects for a page or master ..."
So, probably yes, only shapes
Yacine

Visisthebest

  • Hero Member
  • *****
  • Posts: 640
Re: Are the items in a Window.Selection object always shapes?
« Reply #2 on: June 15, 2022, 05:19:45 AM »
Thank you Yacine that is good to know!
Visio 2021 Professional