# Ruby with CDO?

**URL:** <https://www.ruby-forum.com/t/ruby-with-cdo/132950>\
**Category:** Ruby\
**Created:** [March 26, 2008, 2:15am UTC](https://www.ruby-forum.com/t/ruby-with-cdo/132950 "2008-03-26T02:15:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [March 26, 2008, 2:15am UTC](https://www.ruby-forum.com/t/ruby-with-cdo/132950/1 "2008-03-26T02:15:13Z")

</div>

Hello,  
I need to do some scripting to interact with a Microsoft Exchange  
server. More specifically, to insert contacts into each user’s mailbox’s  
contacts folder. I have accomplished this with Ruby via Win32OLE and  
MAPI, but it has become evident that I cannot use this method to iterate  
over every mailbox without major issues, primarily because the MAPI  
method goes into Exchange via Outlook using the current user account’s  
credentials.

Thus, I need to enter Exchange using a more direct approach. From what I  
read, I need to use CDO 1.2.1. However, I don’t know much about CDO or  
how I am to go about using it. I was wondering if anybody has an  
experience with this or if anybody can get me pointed in the right  
direction. I’d really prefer to use Ruby instead of VB, and I think its  
possible… just not sure exactly how.

Any help is appreciated!!

Thanks,

- Jeff M.

---

<div class="post-metadata">

**Author:** ![sithadmin](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@sithadmin](https://www.ruby-forum.com/u/sithadmin)\
**Post date:** [March 27, 2008, 9:15am UTC](https://www.ruby-forum.com/t/ruby-with-cdo/132950/2 "2008-03-27T09:15:55Z")

</div>

I’m a newbie to CDO as well.

Did you check out the CDO reference on msdn2?

> **[CDO Reference](https://learn.microsoft.com/en-us/previous-versions/exchange-server/exchange-10/ms526914(v=exchg.10)?redirectedfrom=MSDN)**

I need to programatically drag and drop an outlook message into a word  
document. Any example snippets would be appreciated.
