the-generalist.com

  • Increase font size
  • Default font size
  • Decrease font size
joomla templates, wordpress themes, drupal, datalife engine, graphics, seo,
Home

Adding a Contact to Outlook Using Python

E-mail Print PDF

It took me a while to find examples of how to add a contact to Outlook using Python. The examples I did find were all longer than the code I ended up with, so I'm going to post my code here. For this to work you need to set up win32com similar to when using Excel. Make sure to run make.py like I mention in that article, but add the Microsoft Outlook 14.0 Object Library instead.

import win32com.client

#Connect to Outlook
Outlook = win32com.client.Dispatch("Outlook.Application")

#Create a new Contact and save it
NewContact = Outlook.CreateItem(win32com.client.constants.olContactItem)
NewContact.FullName = 'NewContact'
NewContact.Save()

This is really straight forward so I don't think I need an explanation, but if you have any questions feel free to leave a comment and I'll try my best to answer them. It's left as an exercise to the reader to do something useful with this functionality.

Last Updated on Thursday, 16 June 2011 04:25  

Comments  

 
0 #24 Esperanza 2017-05-16 00:51
Hi my loved one! I wish to say that this post is amazing, nice written and
come with almost all significant infos. I would like to peer more posts like this.
Quote
 
 
0 #23 pinger tool 2017-04-20 00:36
Hi there, I enjoy reading through your post. I like
to wrrite a little comment to support you.
Quote
 
 
0 #22 UppTalk Free Credits 2017-04-19 09:00
This web site certainly has all of the information and facts I wanted about this subject
and didn't know who to ask.
Quote
 
 
0 #21 Robbin 2016-04-23 21:08
We are constantly online tjerefore if you have got some compllications with using our secrets aand cheats or need to ask us
a question, perform not really hesitate to contact us at any time!
Quote
 
 
0 #20 Flor 2016-03-06 04:38
We were pressured to add this advanced program as a result of poor spam bots, causes harm to
our servers.
Quote
 
 
0 #19 http://freehack2015. 2015-10-25 04:14
This is really interesting, You're a very skilled blogger.
I have joined your feed and look forward to seeking more of your magnificent post.
Also, I have shared your website in my social networks!
Quote
 
 
0 #18 clash of clans free 2015-10-07 21:53
No download important, this hack takes place in the browser, unlike most other CoC hacks that are probably a virus.
Quote
 
 
0 #17 clash of clans hack 2015-10-04 11:27
Clash of Clans hack might be exceptionally suitable let's assume that you're
an eager person of the game.
Quote
 
 
0 #16 clash of clans hack 2015-09-20 09:40
There are many of New Clash of clans gem hack equipment
which may bypass the machine and make you guess that you are getting the free gems.
Quote
 
 
0 #15 clash of clans hack 2015-07-26 20:57
Since it's a popular game in virtually any social platform or
portable operating-system, Clash of Clans jailbreak hack is also
versatile.
Quote
 

Add comment


Security code
Refresh

Main Menu