How can I get stencil document name by the shape object?

P

Pedro Silva

When I drag and drop a Shape I listen to such event. How can I get the
document name of the stencil which I had drag my shape?
 
H

H Wu

I think u can get shape's Master and from Master u can get the Stencil
document object.
Visio.Document ovDoc = ovShape.Master.Document;
ovDoc.Name or ovDoc.FullName
 
M

Mark Nelson [MS]

There is no way to know what document a shape originated from. Technically
all shapes originate from the local document. When you drag a shape from a
stencil into the document, Visio first copies the shape master to the local
document. Then it creates an instance of that master on the page.

You can use the Shape.Master property to find out what master an instance
comes from, but this is a reference to the master in the local document.

--
Mark Nelson
Office Graphics - Visio
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top