| 1 |
ninoborges |
8 |
## Testing automating Outlook
|
| 2 |
|
|
## This is not ment to be run as a program or imported as a module. Its just a reference
|
| 3 |
|
|
## outlook date formatting is "mmmm dd, yyyy hh:mm am/pm"
|
| 4 |
|
|
#Eaborges
|
| 5 |
|
|
#12.28.01
|
| 6 |
|
|
|
| 7 |
|
|
from win32com.client import Dispatch
|
| 8 |
|
|
from win32com.client import constants
|
| 9 |
|
|
|
| 10 |
|
|
def Main():
|
| 11 |
|
|
o=Dispatch("Outlook.Application.9")
|
| 12 |
|
|
|
| 13 |
|
|
|
| 14 |
|
|
def Contacts():
|
| 15 |
|
|
contact = o.CreateItem(constants.olContactItem)
|
| 16 |
|
|
contact.FullName = "Test"
|
| 17 |
|
|
contact.PrimaryTelephoneNumber = "555-5555"
|
| 18 |
|
|
contact.Save()
|
| 19 |
|
|
|
| 20 |
|
|
def Calendar():
|
| 21 |
|
|
appointment = o.CreateItem(win32com.client.constants.olAppointmentItem)
|
| 22 |
|
|
appointment.Subject = "Gone to gym"
|
| 23 |
|
|
appointment.Location = "Capital Club"
|
| 24 |
|
|
appointment.Start = "12 29, 2001 03:00 pm"
|
| 25 |
|
|
appointment.End = "12 29, 2001 4:00 pm"
|
| 26 |
|
|
appointment.Save() |