Re: saving word files
| From: | Nick | Date: | Tue, 19 Apr 2005 19:23:54 +0000 |
| Subject: | Re: saving word files | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-25881@lists.php.net to get a copy of this message | ||
Just a note to those wanting to use COM to interface to printers under Windows 2000/XP. If it
doesn't work or seems to hang, try changing the logon identity under which the Apache (assuming
you're using Apache) service is running from the System account to another account. By default
most services will install to run under the System account and although the System account has total
authority on the computer it is running on, it has no authority outside of that realm as I
understand it. Apparently accessing printers is considered "outside the realm". I used
this technique to interface a Dymo thermal label printer to my server and it works now.
i selected another account on my pc like "Nick", he is admin
i tried it, but always this error
Could not start the Apache service on Local Computer.
Error 1069: The service did not start due to a logon failure
any help?
"Nick" <glenn.brutyn@telenet.be> wrote in message news:20050419191138.15772.qmail@lists.php.net...
> i need to print the word file, but first testing by saving
>
> this seems not to work, site keeps loading :s:s:s nothing happens
>
> <?php
> $word = new COM("word.application") or die("Unable to instantiate Word");
> $file = "c:/reminder.doc";
> $word->Documents->Open($file);
> $new_file = "c:/reminder_new.doc";
> $word->Documents[1]->SaveAs($new_file);
> $word->Quit();
> $word->Release();
> $word = null;
> ?>
>
> this neither, also much loading time, nothing happens
>
>
> // starting word
> $word = new COM("word.application") or die("Unable to instanciate Word");
> print "Loaded Word, version {$word->Version}\n";
> // bring it to front
> $word->Visible = true;
> // Open a word document, or anything else that word can read
> $input ="c:\\beginverslag.doc";
> $word->Documents->Open($input);
> $new_file = "c:\\test.doc";
> $word->Documents[1]->SaveAs($new_file);
> // closing word
> $word->Documents[1]->Close(false);
> $word->Quit();
> // free the object
> $word->Release();
> $word = null;
> unset($word);
>
> any suggestions?????