A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Need help scraping calendar info



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 4th 06, 03:53 PM posted to microsoft.public.outlook.program_vba
rut
external usenet poster
 
Posts: 2
Default Need help scraping calendar info

Can anyone guide me to some samples as to how to get the data
(programatically) from an outlook calendar? I need this in vb.net code
for a program I am writing to grab the data to populate a sql server
db.

Thanks
Rut

Ads
  #2  
Old July 4th 06, 05:29 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Need help scraping calendar info

This code is a good starting point:

Imports System.Reflection

Module Module1

Sub Main()
' Create Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application

' Get namespace and Contacts folder reference.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
Dim oAppointments As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar)

' Get the first contact from the Contacts folder.
Dim oItems As Outlook.Items = oAppointments.Items
Dim oAppt As Outlook.AppointmentItem

Dim iCount As Int16
iCount = 0

oAppt = oItems.GetFirst()

Do While Not oAppt Is Nothing
iCount += 1

' Display some common properties.
Console.WriteLine(oAppt.Subject)
Console.WriteLine(oAppt.Start)
oAppt = oItems.GetNext
Loop

Console.WriteLine(iCount)

' Clean up.
oApp = Nothing
oItems = Nothing
oAppt = Nothing

End Sub
End Module

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"rut" wrote:

Can anyone guide me to some samples as to how to get the data
(programatically) from an outlook calendar? I need this in vb.net code
for a program I am writing to grab the data to populate a sql server
db.

Thanks
Rut


  #3  
Old July 5th 06, 12:42 PM posted to microsoft.public.outlook.program_vba
rut
external usenet poster
 
Posts: 2
Default Need help scraping calendar info

Thanks. I'm a little confused though. Does this bring back contacts or
calendar infor?

Also, would this work going directly against the exchange server?

Thanks,
Rut


Eric wrote:
This code is a good starting point:

Imports System.Reflection

Module Module1

Sub Main()
' Create Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application

' Get namespace and Contacts folder reference.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
Dim oAppointments As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar)

' Get the first contact from the Contacts folder.
Dim oItems As Outlook.Items = oAppointments.Items
Dim oAppt As Outlook.AppointmentItem

Dim iCount As Int16
iCount = 0

oAppt = oItems.GetFirst()

Do While Not oAppt Is Nothing
iCount += 1

' Display some common properties.
Console.WriteLine(oAppt.Subject)
Console.WriteLine(oAppt.Start)
oAppt = oItems.GetNext
Loop

Console.WriteLine(iCount)

' Clean up.
oApp = Nothing
oItems = Nothing
oAppt = Nothing

End Sub
End Module

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"rut" wrote:

Can anyone guide me to some samples as to how to get the data
(programatically) from an outlook calendar? I need this in vb.net code
for a program I am writing to grab the data to populate a sql server
db.

Thanks
Rut



  #4  
Old July 7th 06, 06:18 PM posted to microsoft.public.outlook.program_vba
Simon Shutter
external usenet poster
 
Posts: 4
Default Need help scraping calendar info

I am new to vba in outlook but I think he meant

' Get namespace and ***Calendar*** folder reference.


' Get the first ***appointment*** from the ***Calendar*** folder.


It's a great start though to explain the object model and you should give a
whirl


"rut" wrote in message
oups.com...
Thanks. I'm a little confused though. Does this bring back contacts or
calendar infor?

Also, would this work going directly against the exchange server?

Thanks,
Rut


Eric wrote:
This code is a good starting point:

Imports System.Reflection

Module Module1

Sub Main()
' Create Outlook application.
Dim oApp As Outlook.Application = New Outlook.Application

' Get namespace and Contacts folder reference.
Dim oNS As Outlook.NameSpace = oApp.GetNamespace("MAPI")
Dim oAppointments As Outlook.MAPIFolder =
oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFo lderCalendar)

' Get the first contact from the Contacts folder.
Dim oItems As Outlook.Items = oAppointments.Items
Dim oAppt As Outlook.AppointmentItem

Dim iCount As Int16
iCount = 0

oAppt = oItems.GetFirst()

Do While Not oAppt Is Nothing
iCount += 1

' Display some common properties.
Console.WriteLine(oAppt.Subject)
Console.WriteLine(oAppt.Start)
oAppt = oItems.GetNext
Loop

Console.WriteLine(iCount)

' Clean up.
oApp = Nothing
oItems = Nothing
oAppt = Nothing

End Sub
End Module

--
Eric Legault (Outlook MVP, MCDBA, MCTS: Messaging & Collaboration)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"rut" wrote:

Can anyone guide me to some samples as to how to get the data
(programatically) from an outlook calendar? I need this in vb.net code
for a program I am writing to grab the data to populate a sql server
db.

Thanks
Rut





 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
import info from old calendar to new calendar SPA_in_Ottawa Outlook - Calandaring 1 June 14th 06 01:19 AM
Sharing calendar info Zalthu Outlook - General Queries 2 June 2nd 06 11:25 AM
I can't save info on my calendar in outlook. Pasta guy Outlook - Calandaring 1 March 28th 06 05:18 AM
synchronizing contact info into the calendar gina Outlook - Calandaring 3 February 27th 06 03:27 PM
calendar info lost [email protected] Outlook - General Queries 0 January 30th 06 06:55 AM


All times are GMT +1. The time now is 08:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.