April 26th, 2002, 03:56 AM
if you want to find out how to call certain functions in word, you can start a 'recording' session, do your stuff and then examine the code the recoder created.
however, i tried to figure out how to create an unordered list and the recorder created about 30 lines of code for one bullit.
so the recorder can only point you in the right direction but is still somewhat helpful.
is it also possible to use DCOM? and how about security on that one?
you can get anything you want at alices restaurant
Only works when using a windows web server?
Hi Devshed, in the article you wrote:
"I'll assume that you have a working PHP-compliant Web server (either Apache or IIS will do)"
I've tried the code (I'm running PHP 4.0.4 under Apache) and nothing worked. I found another article on PHP & COM and it stated:
"Note that this only works when you are running PHP on a Windows Web server."
Now, who is right? Or is it because of my PHP version?
June 11th, 2002, 04:31 PM
I ran the excel code and got nasty errors that each line of code couldn't be run. I opened excel closed the assistant and it worked great.
Just a tip if anyone else has the same problem.
I develop in VB so this was great article to read!
January 24th, 2003, 03:53 PM
Using PHP to interface with COM objects does have its advantages, but there is a nasty little quirk with doing this that I noticed the other day. I did the Excel and Word examples and then my computer messed up after I had played a game. I did a CTRL-ALT-DEL to bring up the task manager, and under the Processes tab I had noticed that multiple copies of excel.exe and winword.exe were running in the background (I had run the php files more than once obviously) and eating up approximately 8,000 and 7,000 Kb of memory respectively for each copy (there were 8 copies running between the two of them, using up about 60 Mb of RAM total). I clicked on them and hit the 'End Process' button but windows gave me some nasty error messages and would not let me close them (I use Windows 2000, so I'm not sure if it does this in other windows systems, but if I was to take an educated guess I would say that there would still be this problem). The only way that I could remedy this problem was to reboot my computer.
March 4th, 2003, 06:36 PM
>> Or is it because of my PHP version?
where can you see the parsing of the word files?
that script MUST be running on windows server with Word installed ;)
btw, if there will be 5-10 simultanious request for parsing files to the script-- the ****ty IIS may go down because of the Word ;)
March 5th, 2003, 11:54 PM
Only on windows
I guess they assume since the article is about accessing Microsoft COM objects, you would understand it has to be running on a Windows server. This is the case, although I know there are some DCOM implementations that are for Linux and I'm hoping to spend some time trying to access MS COM objects through DCOM from a Linux server. Just for grins.
PHP and COM
PHP and COM
You've already seen how PHP can be used to interface with Java components and JavaBeans. But here's something you didn't know - PHP can (shock shock! horror horror!) even be used to interface with Microsoft COM objects on the Windows platform. Will this be a happy marriage? Read on to find out.
Please discuss this article in this thread. You can read the article here .
Just had a quick look through and it looks quite good. I have used PHP with Outlook and Excel quite a bit and have been doing VB COM programming for a few years now.
One thing to be wary of is I have seen many tutorials and articles use constants that are predefined in VB but are not available in PHP.
I just grabbed this off a tutorial site, code doesnt work since 'olMailItem' is not defined. When you want to convert VB code or try and get junk like the above working its good to have MS Access or Excel running with the VB window open and type into the Immediate window in the IDE ?olMailItem which will print out the value of the constant. You then replace the word with the numerical value.
$objApp = new COM("Outlook.Application");
$myItem = $objApp->CreateItem(olMailItem);
If you would like to see an article covering a particular topic, please post your request here.