Re: How do I resolve: Requested operation is presently disabled when calling a Visio Shape object via a loop?
- From: eggmatters@xxxxxxxxx
- Date: Fri, 30 May 2008 13:17:56 -0700 (PDT)
On May 29, 6:48 pm, Paul Herber
<SubstituteMyFirstNameH...@xxxxxxxxxxx> wrote:
On Thu, 29 May 2008 14:57:03 -0700 (PDT), eggmatt...@xxxxxxxxx wrote:
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]);
}
}
Your code attempts to change the shape's test. Does this bit work
correctly? The two "delete" lines, what are they trying to do? What is
in the two arrays? Which line causes the exception? (Delete each line
in turn to find out !)
--
Regards, Paul Herber, Sandrila Ltd.http://www.sdl.sandrila.co.uk/ SDL/MSC/TTCN/URN/UML2 for Visio
Well, it only works if the shape has been created - which just gave me
an idea - or I am calling it once, ot recursively or in a loop.It
fails when called there. I forgot to change the array names in delete
lines. They should be Original_arraylist and Different_array. I am
delelting them since I am doing an exponential search and replace, I
want to optimize that by deleting vaulues that have already been used.
.
- References:
- Prev by Date: Re: How do I resolve: Requested operation is presently disabled when c
- Next by Date: Re: Change "Protect Document - Shapes" Programatically ?
- Previous by thread: Re: How do I resolve: Requested operation is presently disabled when calling a Visio Shape object via a loop?
- Next by thread: Re: How do I resolve: Requested operation is presently disabled when c
- Index(es):
Relevant Pages
|