bm4499 Posted March 16, 2010 Share Posted March 16, 2010 Does anyone know how to start a ms-word template via php? Quote Link to comment Share on other sites More sharing options...
FD_F Posted March 16, 2010 Share Posted March 16, 2010 you can open only in server side using shell_exec("C:\Word Folder\winword.exe /ttemplate name"); more info: http://support.microsoft.com/kb/290961 Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 17, 2010 Author Share Posted March 17, 2010 you can open only in server side using shell_exec("C:\Word Folder\winword.exe /ttemplate name"); more info: http://support.microsoft.com/kb/290961 So when we have intranet and we want to let users start templates via Intranet and MS-Word, it should not be possible to run the template onto visitors their local computer? Quote Link to comment Share on other sites More sharing options...
trq Posted March 17, 2010 Share Posted March 17, 2010 PHP executes on the server so no. Not unless you open a local directory on the server itself. Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 17, 2010 Author Share Posted March 17, 2010 PHP executes on the server so no. Not unless you open a local directory on the server itself. Hmm, I see, how about another way to reach our target? Java? Quote Link to comment Share on other sites More sharing options...
trq Posted March 17, 2010 Share Posted March 17, 2010 All server-side languages will have the same issue. Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 17, 2010 Author Share Posted March 17, 2010 All server-side languages will have the same issue. Hmm, thanks for your answer. Then we have to find another solution. Quote Link to comment Share on other sites More sharing options...
trq Posted March 17, 2010 Share Posted March 17, 2010 I have no idea what an ms-word template actually is, but you could create it on the server and then have your users download it. Or, you could (like I mentioned) try opening the template on a remotely accessed drive. Given the correct permissions, I can open remote drives from my windows machine at work quite easily. \\machinename\c$ Will give me access to the C drive of the pc called machinename for instance. Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 17, 2010 Author Share Posted March 17, 2010 I have no idea what an ms-word template actually is, but you could create it on the server and then have your users download it. Or, you could (like I mentioned) try opening the template on a remotely accessed drive. Given the correct permissions, I can open remote drives from my windows machine at work quite easily. \\machinename\c$ Will give me access to the C drive of the pc called machinename for instance. a template is a written word doc with some wizzards that the use has to fill. The internal VBA software is taking care for things like house style, layout and other automated information. You're right, the best way to do this all is at the server-side, but there is a big BUT: Our current templates (many!) are based and adjusted for usage on their local machines, it looks up e.g. username, file counter and other stuff like that. Copying this stuff to server-side is not an easy option for us. It's so strange, Windows-update and many online virusscanners are able to access your computer as well but we cannot... Quote Link to comment Share on other sites More sharing options...
trq Posted March 17, 2010 Share Posted March 17, 2010 It's so strange, Windows-update and many online virusscanners are able to access your computer as well but we cannot... Windows updates use an ActiveX control I believe, you could also maybe achieve what you want with a Java applet. Either way, this board is for help with existing third party code. Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 18, 2010 Author Share Posted March 18, 2010 It's so strange, Windows-update and many online virusscanners are able to access your computer as well but we cannot... Windows updates use an ActiveX control I believe, you could also maybe achieve what you want with a Java applet. Either way, this board is for help with existing third party code. I've found another way to reach my target: I made a sharedir at my local windows machine and with an executable I am looking each 1,5 second (via a timer) if there is a textfile in this directory which consist the right msword (*.dot) or msexcel (*.xlt) and start this template... This is tested successfully. Now I have a problem that I cannot write the textfile into \\ipaddress\templatehelp\...... even creating the file to the root of the server c:\ and copying it to \\ipaddress\templatehelp\* is not working... :-( What's wrong with this? Quote Link to comment Share on other sites More sharing options...
trq Posted March 18, 2010 Share Posted March 18, 2010 Sounds like a permissions issue. Nothing to do with php. Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 18, 2010 Author Share Posted March 18, 2010 Sounds like a permissions issue. Nothing to do with php. I see, thanks for the advice, then I can continue seek to find the 'why' :-) Quote Link to comment Share on other sites More sharing options...
bm4499 Posted March 18, 2010 Author Share Posted March 18, 2010 Sounds like a permissions issue. Nothing to do with php. I see, thanks for the advice, then I can continue seek to find the 'why' :-) $datatowrite = 'tmpl.dot'; $fhdl = fopen('\\\\10.0.0.7\\App\\test.txt', 'w') or die("can't open file"); fwrite($fhdl,$datatowrite); fclose($fhdl); Why is this code not working? When I use this line the file successfully is created: $fhdl = fopen('C:\\test.txt', 'w') or die("can't open file"); note: 10.0.0.7 is not the webserver but just a workstation on the same router as the webserver Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.