in reply to Re: Access Visio in Perl
in thread Access Visio in Perl

I have a data dictioary and an io table (what data elements/variables each subprogram is sending and where they are sending them to) defined in MS Access. My plan is to have Perl access this data and generate Data Flow Diagrams. I have successfully accessed the database and am able to place standard objects (a circle, representing a process) from Visio's stencel onto the Visio document. What I can't do is name that circle (ie. I want the circle to be called "Process X". I looked at using Visio's 'database wizard'. The best I could make of their 'on-line' help is that I could draw the data flow and link the data to MS Access. The diagram would could never change, but the data would stay updated. Any ideas on how to name a bubble in Visio via Perl?

Replies are listed 'Best First'.
Re: Re: Re: Access Visio in Perl
by chunlou (Curate) on Jul 23, 2003 at 22:59 UTC
    Suppose you have a shape in test.vsd:
    use strict; use warnings; use Win32::OLE; $Win32::OLE::Warn = 3; my $path = "D:\\FilePath\\"; my $file = "test.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} = "Biggie Ole"; print $VShape->{Text}; $VDoc->SaveAs($path."test2.vsd");
    Open Up the Shrinkwrap with OLE is a good (albeit old) article on Visio OLE (a 2MB PDF).
      Do you know how to assign values to "custom properties" of objects in Visio? I've tried $Object_Handle->{Prop.Module_Name} = ("$module_name"); No luck.