in reply to Re: How do I dicern and pull data elements from a Visio
in thread How do I dicern and pull data elements from a Visio

Interesting. I've looked at the shapes module in CPAN and there certainly doesn't seem to be any 'get' methods for this. I've also found literally no compendium of OLE documentation for this available. The xml schema is well-formed enough for the purposes of Visio but not for parsing. It appears that they engage some strange encoding and it's a mess trying to escape it all. If I am successful, I will append a module to CPAN once all is said and done.
  • Comment on Re^2: How do I dicern and pull data elements from a Visio

Replies are listed 'Best First'.
Re^3: How do I dicern and pull data elements from a Visio
by eggmatters (Initiate) on Feb 28, 2008 at 17:41 UTC
    If anybody is still tracking this thread: Ok, easy enough to answer. It was yet another thread on this site where I found it. Here is some code that got me started:
    use strict; use warnings; use Win32::OLE; $Win32::OLE::Warn = 3; my $path = "c:\\Documents and Settings\\eggmatters\\Desktop\\VisioProj +ect\\"; my $file = "viSamp.vsd"; my $Visio = Win32::OLE->new('Visio.Application', 'Quit'); my $VDocs = $Visio->Documents; my $VDoc = $VDocs->Open("$path$file"); my $VPage = $VDoc->Pages->Item(1); my $VShapes = $VPage->Shapes; my $VShape = $VShapes->Item(1); $VShape->{Text} = "New Name"; print $VShape->{Text}; $VDoc->SaveAs($path."test2.vsd");
    Here, I've assigned the text before dicerning it but that doesn't matter. To 'get' the text, you just need to call $VShape->(Text); and there you have it. For people like me who have to rely on Visio modeling of Web sites and applications, This will definitely be a huge bonus in implementing validation tools and chart editors.