Properties serialization

M

Marek

Hello.

Is there any possibility to "serialize" properties of Visio objects? For
example, I have a DB model with some entities. I'd like to save selected (or
all) properties of these entities into xml or xls file.

Thanks for any given answer.

Marek
 
C

Chris Roth [ Visio MVP ]

More than you wanted:

Visio files can be saved in an xml format, called .vsx, but that's just the
graphics according to the .vsx schema.

Visio allows the storage of "SolutionXML" inside of it's file. Check the
developer reference and read about SolutionXML. Some of the solutions
utilize this "bucket" to store the solution-specific info. Visio, the
application leaves this info alone, and simply stores it, sort of like an
OLE stream, I guess. Your code or add-on writes meaningful info to
SolutionXML trees.


The actual database solution that you care about uses a different
info-storage method. There is an invisible master stored in the document's
"Document Stencil". To get at it with code, you would run something like
this:


dim shp as visio.shape
set shp = ThisDocument.Masters("Database Model").Shapes(1)
' Note: VBA only for 'ThisDocument', otherwise
Visio.Documents.Item("...")


This shape is some sort of custom OLE control that the Visio C++ guys
developed. We used to refer to them as bit-buckets before all this solution
xml stuff came along.

I am not sure if you can get into this thing and see what's going on. I'm a
developer, but not super-100%-hard core one. I'm not sure what interfaces
this thing exposes. And it's certainly not officially supported to go
mucking around. But if you can get at it, and READ data, what harm could
there be? (until they change it in the next version....roll eyes
here...okay, now that I've lost my MVP charter, have fun!)


--

Hope this helps,

Chris Roth
Visio MVP
 
M

Marek

Thanks Chris!

Chris Roth said:
More than you wanted:

Visio files can be saved in an xml format, called .vsx, but that's just the
graphics according to the .vsx schema.

Visio allows the storage of "SolutionXML" inside of it's file. Check the
developer reference and read about SolutionXML. Some of the solutions
utilize this "bucket" to store the solution-specific info. Visio, the
application leaves this info alone, and simply stores it, sort of like an
OLE stream, I guess. Your code or add-on writes meaningful info to
SolutionXML trees.


The actual database solution that you care about uses a different
info-storage method. There is an invisible master stored in the document's
"Document Stencil". To get at it with code, you would run something like
this:


dim shp as visio.shape
set shp = ThisDocument.Masters("Database Model").Shapes(1)
' Note: VBA only for 'ThisDocument', otherwise
Visio.Documents.Item("...")


This shape is some sort of custom OLE control that the Visio C++ guys
developed. We used to refer to them as bit-buckets before all this solution
xml stuff came along.

I am not sure if you can get into this thing and see what's going on. I'm a
developer, but not super-100%-hard core one. I'm not sure what interfaces
this thing exposes. And it's certainly not officially supported to go
mucking around. But if you can get at it, and READ data, what harm could
there be? (until they change it in the next version....roll eyes
here...okay, now that I've lost my MVP charter, have fun!)


--

Hope this helps,

Chris Roth
Visio MVP
 

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