| djaekimaar@hotmail.com 2004-09-24, 3:59 pm |
| Hello can anyone help. I am trying to get to the Contacts located in
Outlook via PHP. I have seen a way to do it via VB but for obvious
reasons don't want to. The code I have is
// starting Outlook
$word = new COM("Outlook.application") or die("Unable to instanciate
Word");
echo "Loaded OUtlook, version {$word->Version}\n";
define(olFolderInbox,6);
$oNs = $word->GetNamespace("MAPI");
$oFldr = $oNs->GetDefaultFolder(olFolderInbox);
$UnreadMessagesInFolder = $oFldr->UnReadItemCount;
echo "Number : $UnreadMessagesInFolder";
//free the object
$word->Release();
$word = null;
?>
When it runs it hangs. An instance of Outlook appears in the task
manager but that is it. If I remove the define statement, (this was
not in the example I foound for word) Then I get the Loaded Outlook
message. Could it be service of some sort I need to be running. I have
Windows XP Professional and have turned on all the services that
remotely lookk like they could be COM related. If I run a similar
script for Word it works.
Any help would be much appreciated.
|