Po zaladowaniu tego skryptu:
[php:1:64e0b05dbd]<?php
$word = new COM("word.application") or die("Unable to instantiate Word");
print "Loaded Word, version {$word->Version}<BR>";
$testversion = com_get($word->application,version);
print "Version using Com_get(): $testversion <BR>";
$word->Visible = 1;
$word->Documents->Add();
$word->Selection->TypeText("This is a test...");
$word->Documents[1]->SaveAs("c:test.doc");
$word->Quit();
?>[/php:1:64e0b05dbd]
dostaje komunikat:
Loaded Word, version 10.0
Version using Com_get(): 10.0
php Notice: Use of undefined constant version - assumed 'version' in C:Inetpubwwwrootphpphpfirmaword.php on line 20 php Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft Word Description: Nie można otworzyć miejsca przechowywania makra. in C:Inetpubwwwrootphpphpfirmaword.php on line 30 php Warning: (null)(): Invoke() failed: Exception occurred. Source: Microsoft Word Description: Żądany element kolekcji nie istnieje. in C:Inetpubwwwrootphpphpfirmaword.php on line 38
mam win2003 (.net) i officeXP
co jest nie tak?
Prosze przeczytac ten topic http://forum.php.pl/viewtopic.php?t=2810 - Seth