Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Perl OLE Question

Status
Not open for further replies.

JoeGilligan

Programmer
Nov 9, 2007
2
US
Hey Everyone,
I am trying to write a Perl script that uses Visio to draw a 'connector' that is attached to two rectangles, however, I am having trouble getting the connector object to draw.
I have:

Code: ( perl )
our $Visio = Win32::OLE->new('Visio.Application') or die "Cannot locate Visio.\n";
$Visio->{'Visible'} = 1;
our $VDocs = $Visio->Documents;
our $VDoc = $VDocs->Open("C:\\visio\\test.vsd");
our $VPage = $VDoc->Pages->Item(1);
our $VShapes = $VPage->Shapes;
our $connector = $VPage->Drop($Visio->ConnectorToolDataObject, 2, 2); #where the error is


Also, I think the VB code for drawing a connector looks something like this

Code: ( text )
Set line = ThisDocument.Pages(1).Drop(Visio.Application.Conne ctorToolDataObject, 2, 2)


The Perl part isn't working for me. I'm not exactly sure of the syntax for how to set this up. If you could help me I'd really appriciate it.
Thanks,
Joseph
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top