E
eggmatters
I receive the following error when I try to write to a text property
of a shape object. I am coding in Perl using a win32::OLE module. So
my problem is trying to loop through a set of Visio objects, change
some text, and write to the object where I want to change. The sample
code is:
#Grab some text from a shape. VB would be: VShape.Text (where
Vshape is built from the visio document.pages.Item.shapes.shape and so
on . . .
my $prompt = $VShape->{Text};
#Here is the loop where I have ported into an array
(successfully) a list of what text is in the Visio -
Original_Array_list and what I want to change it to: Different_Array.
for ($i = $#Original_Array_list; $i >=0; $i--)
{
if (defined $prompt)
{
#This regex changes prompt to the Value of Different_Array
if the Original_Array[$i] element is present
if ($prompt =~ s/$Original_Array_list[$i]/
$Different_Array_List[$i]/g)
{
# this is where the exception is thrown:
$VShape->{Text} = $prompt;
delete($EnglishPrompts[$i]);
delete($SpanishPrompts[$i]);
}
}
of a shape object. I am coding in Perl using a win32::OLE module. So
my problem is trying to loop through a set of Visio objects, change
some text, and write to the object where I want to change. The sample
code is:
#Grab some text from a shape. VB would be: VShape.Text (where
Vshape is built from the visio document.pages.Item.shapes.shape and so
on . . .
my $prompt = $VShape->{Text};
#Here is the loop where I have ported into an array
(successfully) a list of what text is in the Visio -
Original_Array_list and what I want to change it to: Different_Array.
for ($i = $#Original_Array_list; $i >=0; $i--)
{
if (defined $prompt)
{
#This regex changes prompt to the Value of Different_Array
if the Original_Array[$i] element is present
if ($prompt =~ s/$Original_Array_list[$i]/
$Different_Array_List[$i]/g)
{
# this is where the exception is thrown:
$VShape->{Text} = $prompt;
delete($EnglishPrompts[$i]);
delete($SpanishPrompts[$i]);
}
}