I'm sorry for trying it again. But doesn't anybody have an idea why Word
freezes in the sample program below?
This program obviously does nothing useful. It is just a test program that
isolates the basic problem of a bigger program that processes all words in
some hundred files (The original program reads the distance of each word
from the left page margin in points).
The test program reads the same file in an endless loop, just to check out
how long it will last until word crahses, because my original programm
always crahsed after some time. It processes each word but does nothing with
it.
I have "perlified" the code a little bit using the map-function for the
inner iterations. But this changes nothing. The programm freezes after
$counter is 70.
====================================
use Win32::OLE qw(in with);
use Win32::OLE::Const 'Microsoft Word';
my $appWD=Win32::OLE->new('Word.Application', 'Quit')
or die "Oops, cannot start Word";
$counter=0;
while(1) {
{
my $aktDoc=$appWD->Documents->Open("Test.doc")
or die "Cannot open WordDoc\n";
map {
map {
;
} (in $_->Range->Words);
} (in $aktDoc->Paragraphs);
$aktDoc->Close;
$counter++;
print "$counter\n";
}
}
========================================
TZS
---
You are currently subscribed to perl-win32-users as: [archive@jab.org]
To unsubscribe, forward this message to
[EMAIL PROTECTED]
For non-automated Mailing List support, send email to
[EMAIL PROTECTED]