Hello NG,

we have a script to create a word-document via COM which, so far, run pretty 
stable under php 4.3.7

Since we upgraded to php 5.0.3.3 the same script works only on the first 
run!
On the following runs the same script causes a fatal error on the code 
below:

Fatal error: Uncaught exception 'com_exception' with message 'Source: 
Microsoft Word
Description: Wrong Parameter.' in [Scriptname]:65
Stack trace:
#0 [Scriptname](65): variant->GoTo('wdGoToField', 'wdGoToFirst', 1)
#1 [SourceScript] include('[Scriptname]')
#2 {main} thrown in [Scriptname] on line 65

Code :
================================================
$NumberFields = $word->ActiveDocument->MailMerge->fields->Count;
for ($CounterFields = 1; $CounterFields <= $NumberFields; $CounterFields++)
{
    $word->Selection->Range->GoTo(wdGoToField, wdGoToFirst, $CounterFields); 
<-- Creates Fatal Error
   ...
}
================================================

When we reset the Apache-Service, the script runs again once! Subsequent 
calls create the same fatal error again ... we changed access-rights in 
dcomcnfg which didn't show any influence ...

Environment: win 2003 server, Apache 2.0.53

I'm greatful for any hint ! 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to