exporting data from outlook calendar into HB list

General HouseBot discussion. Any issues that don't fit into any of the other topics belong here.
Post Reply
vcruz777
Member
Posts: 70
Joined: Sun Jul 08, 2007 9:39 pm

exporting data from outlook calendar into HB list

Post by vcruz777 »

I would like to export data from my outlook calendar into Housebot to add reminders and be able to see my agenda for the day when I wake up. Have anybody developed a vbscript to do this already or can give me some pointers on howto do it. I want to use outlook since it is the one in sync with my blackberry.

Any help will be greatly appreciated.

Victor
Richard Naninck
HouseBot Guru Extraordinaire
Posts: 1121
Joined: Tue Sep 28, 2004 7:49 am
Location: The Netherlands

Post by Richard Naninck »

This is what I copied some time ago from this forum. I don't know whom I got it from anymore. Hope it helps a bit...

Code: Select all

Set appOutl = Wscript.CreateObject("Outlook.Application") 
Set objSession = appOutl.GetNameSpace("MAPI") 
objSession.Logon "Outlook" 

' 3 = "Deleted Items" 
' 4 = "Outbox" 
' 5 = "Sent Items" 
' 6 = "Inbox" 
' 9 = "Calendar" 
' 10 = "Contacts" 
' 11 = "Journal" 
' 12 = "Notes" 
' 13 = "Tasks" 
' 15 = "Reminders" 
' 16 = "Drafts" 

' *** INBOX folder 
Set MyFolder = objSession.GetDefaultFolder(6) 
Msgbox MyFolder.name & ", " & MyFolder.Items.Count 

' Set MyItem to the collection of items in the folder. 
Set myItems = myFolder.Items 
' Loop through all of the items in the folder. 
For I = 1 to MyFolder.Items.Count 
MsgBox MyItems(I).subject 
MsgBox MyItems(I).body 
Next 

' *** Contacts Folder 
Set MyFolder = objSession.GetDefaultFolder(10) 
Msgbox MyFolder.name & ", " & MyFolder.Items.Count 
Set myItems = myFolder.Items.Restrict("[MessageClass] = 'IPM.Contact'") 
For I = 1 to MyFolder.Items.Count 
MsgBox MyItems(I).FullName 
Next 
vcruz777
Member
Posts: 70
Joined: Sun Jul 08, 2007 9:39 pm

Post by vcruz777 »

Thanks Richard, it helped a lot.

Victor
Post Reply