Visio Guy

Visio Discussions => Programming & Code => Topic started by: Visisthebest on June 15, 2022, 09:46:53 AM

Title: Are the items in a Window.Selection object always shapes?
Post by: Visisthebest on June 15, 2022, 09: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?
Title: Re: Are the items in a Window.Selection object always shapes?
Post by: Yacine on June 15, 2022, 09: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
Title: Re: Are the items in a Window.Selection object always shapes?
Post by: Visisthebest on June 15, 2022, 10:19:45 AM
Thank you Yacine that is good to know!