Hi,

I'm trying to make a word file. I've seen the little code on PHP4 manual on Zend site
I test this code on my system it works fine, but when attempting to format a little bit text ... give me errors like the followings:

Warning: PropGet() failed: No description available in c:\easyphp\www\wd2.php on line 13

Warning: Invoke() failed: Type mismatch in c:\easyphp\www\wd2.php on line 13

Does any one have experience about COM functions or sample code. I sent this mesaage to some php mailling list for getting help, I did not get any response.This is very important since according to capability of COM function , I will decide whether use PHP on my new project.

Thanks.

Cengiz Soyukan

    Hi Cengiz

    You can have a look at alain samoun's COM article at http://phpbuilder.com/

    There are many bugs in the COM implementation of PHP 4.02 so it might not be an error on your part. It's best you post your code here if you want any hints.

    I also have some info on COM at http://php.weblogs.com/com_php

    Regards, John

      Thanks,

      My script is open an existing word document and insert a 3 column,3 row table in the active document

      <?
      $word=new COM("word.application") or die("Cannot start word for you");
      print "Loaded word version ($word->Version)\n";
      $word->visible =1 ;
      $word->Documents->Open("c:\sil.doc");
      $word->Selection->InsertAfter ("This is section 1.");
      $word->ActiveDocument->Tables->Add($word->ActiveDocument->Range->SetRange(0,0),3,3); ---------> line 13
      $word->Documents[1]->Saveas("c:\sil3.dot");
      $word->Quit();

      ?>

      I got error message :

      Loaded word version (8.0a)
      Warning: PropGet() failed: No description available in c:\easyphp\www\wd2.php on line 13

      Warning: Invoke() failed: Type mismatch in c:\easyphp\www\wd2.php on line 13

      Thanks:

      Cengiz Soyukan

        a year later

        Hello,

        you have to use '\' :

        so u should write:
        $word->Documents->Open("c:\sil.doc");
        $word->Documents[1]->Saveas("c:\sil3.dot");

        cya

          Write a Reply...