For Programmers: Free Programming Magazines  


Home > Archive > PHP Language > September 2004 > Getting to Outlook









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Getting to Outlook
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.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com