Doug,

I'm replying on-list in case anyone else is interested.
Here's an excerpt from Nathan's tip sheet.

-David

=============================================================
II.   ColdFusion Tip: OUTLOOK: Create a contact 
=============================================================

To get this to work you need Outlook on the Web Server that is script is 
on.

<!--- Try to connect to the Outlook application object --->
<CFTRY>    
<!--- If it exists, connect to it --->    
<CFOBJECT
        ACTION="CONNECT"         
        CLASS="Outlook.Application"         
        NAME="objOutlook"         
        TYPE="COM">  
<CFCATCH>    

<!--- The object doesn't exist, so create it --->    
<CFOBJECT         
        ACTION="CREATE"         
        CLASS="Outlook.Application"         
        NAME="objOutlook"         
        TYPE="COM">   
</CFCATCH>
</CFTRY>

<!--- This will add a new contact successfully --->

<CFSCRIPT>    

/* Get the object name space - currently MAPI is the only option */    
objNameSpace = objOutlook.getNameSpace("MAPI");

/* We want to set the folder to create  */    
/* the contact in '10' is the 'Contacts' folder */    
objFolder = objNameSpace.getDefaultFolder(10);

/* Create a new contact structure using */    
/* 'CreateItem' - '2' is for 'New Contact' */    
newContact = objOutlook.CreateItem(2);

/* Set properties for the new contact -- there are several others 
available */    
newContact.FullName = "Dain Anderson";    
newContact.BusinessAddressStreet = "Somewhere";    
newContact.BusinessAddressCity = "Raleigh";    
newContact.BusinessAddressState = "NC";    
newContact.BusinessAddressPostalCode = "12345";    
newContact.BusinessTelephoneNumber = "111-111-1111"; 
newContact.BusinessFaxNumber = "111-111-1111";    
newContact.BusinessHomePage = "http://www.prodigalweb.com";    
newContact.HomeTelephoneNumber = "333-333-3333";    
newContact.MobileTelephoneNumber = "444-444-4444";    
newContact.Email1Address = "[EMAIL PROTECTED]";    
newContact.CompanyName = "Prodigal Web";    
newContact.JobTitle = "Good Question";

/* Save the contact */    
newContact.Save();

/* If you're developing locally, uncomment the next line to see the 
results */    

/* newContact.Display(); */   
</CFSCRIPT> 



=============================================================
III.  ColdFusion Tip:  OUTLOOK: List Contacts and Distribution Lists 
=============================================================
To get this to work you need Outlook on the Web Server that is script is 
on.

<!--- Try to connect to the Outlook application object --->
<CFTRY>    

<!--- If it exists, connect to it --->    
<CFOBJECT 
        ACTION="CONNECT"         
        CLASS="Outlook.Application"         
        NAME="objOutlook"         
        TYPE="COM">  
<CFCATCH>    

<!--- The object doesn't exist, so create it --->    
<CFOBJECT         
        ACTION="CREATE"         
        CLASS="Outlook.Application"         
        NAME="objOutlook"         
        TYPE="COM">   
</CFCATCH></CFTRY>

<!--- This will loop through contacts successfully --->
<CFSCRIPT>    

/* Get the object name space - currently MAPI is the only option */    
objNameSpace = objOutlook.getNameSpace("MAPI");

/* We want to set the folder to get */    
/*  the contacts in - '10' or the 'Contacts' folder */    
objFolder = objNameSpace.getDefaultFolder(10);

/* Return the 'Items' collection */    
objAllContacts = objFolder.Items;

</CFSCRIPT>

<CFOUTPUT>

You currently have #objAllContacts.Count# contacts:
<P>

<!--- Loop through the 'Contacts' collection --->

<CFLOOP COLLECTION="#objAllContacts#" ITEM="this">    

<!--- Ensure it's a 'Contact' --->    
<CFIF (this.Class EQ 40) AND (Len(this.Email1Address) GT 0)>        

<A HREF="mailto:#this.Email1Address#">#this.FullName#</A><BR>    

<!--- It's a 'Distribution List' --->        
<CFELSEIF (this.Class EQ 69) AND (Len(this.DLName) GT 0)>        
<A HREF="sendDistro.cfm?distroID=#this.EntryID#">#this.DLName#</A> 
(Distro)<BR>    
</CFIF>

</CFLOOP>
</CFOUTPUT>



=============================================================
IV.   ColdFusion Tip: OUTLOOK: List tasks  
=============================================================

To get this to work you need Outlook on the Web Server that is script is 
on.


<CFSCRIPT>   
/* Get the object name space - currently MAPI is the only option */ 
objNameSpace = objOutlook.getNameSpace("MAPI");

/* We want to set the folder to get the task in - '13' or the 'Tasks' 
folder */        
objFolder = objNameSpace.getDefaultFolder(13);

/* Return the folder's Items collection */  
objAllTasks = objFolder.Items;

/* Create a counter out of the number of items in the collection */   
objCount = objAllTasks.Count;

/* Sort by CreationTime */    
objAllTasks.Sort("[CreationTime]", 1);       

/* Get the first Task */ 
thisTask = objAllTasks.getFirst();

/* Loop through the Task collection */    
for (i=1; i LTE count; i = i + 1)   
{ 
/* These will be standard tasks ('Items Object' type of 48) */
     if(thisTask.Class EQ 48)  {  

          WriteOutput(thisTask.EntryID & "," & thisTask.Subject & 
"<BR>");   
      }     
       thisTask = objAllTasks.getNext();    
   }
</CFSCRIPT>

Or... 

You could also loop through the Tasks with a CFLOOP: 


<CFOUTPUT>
You currently have #objAllTasks.Count# tasks pending:<P>
<!--- Loop through the 'Tasks' collection --->
<CFLOOP COLLECTION="#objAllTasks#" ITEM="this">   
      <!--- Ensure it's a 'Task' --->    
      <CFIF (this.Class EQ 48) AND (Len(this.Subject) GT 0)>    
           <A HREF="viewTask.cfm?entryID=#this.EntryID#">
               #this.Subject#
           </A><BR>    
      </CFIF>
</CFLOOP>
</CFOUTPUT>

Check out connections to other objects like this at
http://www.cfm-resources.com/members/comet/


On Thu, 31 Aug 2000 13:32:15 -0700 [EMAIL PROTECTED] writes:
> 
> Has anyone worked with any gateways or other tools where you could 
> pull data
> from MS SQL and have that data be pushed into Exchange/Outlook as 
> contacts,
> appointments, to do lists, etc.?
> 
> E-mail me off-list at [EMAIL PROTECTED] if you have done any work 
> with
> this.
> 
> --Doug
________________________________________________________________
YOU'RE PAYING TOO MUCH FOR THE INTERNET!
Juno now offers FREE Internet Access!
Try it today - there's no risk!  For your FREE software, visit:
http://dl.www.juno.com/get/tagj.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to