I można to zrobić, używając COM:
<?php //bring word to the front $word->visible = 1; //open a word document $word->Documents->Add(); //add some text to the document $word->Selection->TypeText("this is some sample text in the document"); //save the document as sampleword.doc $word->Documents[1]->SaveAs("sampleword.doc"); //close word $word->Quit(); //free object resources $word->Release(); $word = null; ?>
Moje pytanie brzmi: gdzie można znaleźć jakieś "repozytorium" tych funkcji COM-PHP, nie tylko dla MS Office, ale generalnie? Jaśniej: gdzie mogę znaleźć informacje o funkcjach, które (tak jak Documents->Add() albo Selection->TypeText) są dostępne?
I czy są jeszcze jakieś sposoby tworzenia dokumentów Worda w PHP?
I jeszcze jedno: czy ta pierwsza metoda działa tak jak otwieranie w Wordzie pliku HTML?