473,549 Members | 2,734 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Automating MS Outlook Agenda

Hi all,

I need to get at specific (shared) agenda-data from MS outlook 2003.

I need every day to get the scheduled 'appointments' for some rooms to Access.
In Access I will show the time-periods that the rooms are booked for that day.
I know how to code all this in Access.
I can show some testdata for 5 rooms quite nicely on a form.

I never ever needed to use Outlook-to-Access before, so I need a good starting point to get the data.
Where do I start to look for some code? I intend to use late-binding.
If I could get the appointments to a csv-file it would be good enough.

Thanks
Arno R
May 10 '06 #1
5 3309
On Wed, 10 May 2006 23:05:27 +0200, "Arno R"
<ar***********@ tiscali.nl> wrote:

One option is to attach the data: Link Tables > Exchange.
Another is to use the Outlook object model. Be sure to perform a FULL
installation of Outlook, so you get all the help files.
Not sure why you would want the appointments as csv (if it's even
possible). I would MUCH rather use one of the above.

If using Automation, and you eventually want late binding, I always
use early binding during development, so I have the benefit of
intellisense.

-Tom.

Hi all,

I need to get at specific (shared) agenda-data from MS outlook 2003.

I need every day to get the scheduled 'appointments' for some rooms to Access.
In Access I will show the time-periods that the rooms are booked for that day.
I know how to code all this in Access.
I can show some testdata for 5 rooms quite nicely on a form.

I never ever needed to use Outlook-to-Access before, so I need a good starting point to get the data.
Where do I start to look for some code? I intend to use late-binding.
If I could get the appointments to a csv-file it would be good enough.

Thanks
Arno R


May 11 '06 #2

"Tom van Stiphout" <no************ *@cox.net> schreef in bericht news:ok******** *************** *********@4ax.c om...
On Wed, 10 May 2006 23:05:27 +0200, "Arno R"
<ar***********@ tiscali.nl> wrote:

One option is to attach the data: Link Tables > Exchange.
Another is to use the Outlook object model. Be sure to perform a FULL
installation of Outlook, so you get all the help files.
Not sure why you would want the appointments as csv (if it's even
possible). I would MUCH rather use one of the above.

If using Automation, and you eventually want late binding, I always
use early binding during development, so I have the benefit of
intellisense.

-Tom.


Thanks Tom,
I will need to investigate more on this.
I never used Outlook myself, so I don't know the object model, not the way Outlook stores data.
I will install Outlook2003 (and install all as you said) and I guess I will find out how I can link to other than the default pst-file.

What I need is to present today's appointments for about 10 meeting-rooms.
I need to present this data in Access (NOT in Outlook)
So what I need is to get today's appointments from these 10 'users'.
I also need to 'massage' the output a bit, that's why I was thinking of importing (to csv or whatever)
From that point (when I have the data) I can do what I want.

I did read the automation-files from ms but I did not find much about importing FROM Outlook.
I looked at some Outlook newsgroups for automation examples, but until now I did not find usable code examples.

Arno R

May 11 '06 #3

"Tom van Stiphout" <no************ *@cox.net> schreef in bericht news:ok******** *************** *********@4ax.c om...

One option is to attach the data: Link Tables > Exchange.


Hi Tom,

I installed Outlook2003 and made a few Agenda entries.
I attached to the Agenda data with Link Tables > Exchange (same result for Link Tables > Outlook here)
All fine exect that the most important field aren't there ... ??
I see all kind of fields including subject, but NO fields for appointment date or appointment time ?????
This is crucial data for an appointment !!
Am I doing something very wrong here, or is MS doing something wrong ???

Testing:
When I export my agenda from Outlook to Access format, and link to the table Agenda in the created mdb then all the data I need is there.
However this method is not what I need.

Thanks,
Arno R
May 11 '06 #4
On Thu, 11 May 2006 18:44:45 +0200, "Arno R"
<ar***********@ tiscali.nl> wrote:

Here is a code fragment to get you started:

Public Sub ReadOutlook()
Dim olApp As Outlook.Applica tion
Dim olNameSpace As Outlook.NameSpa ce
Dim objCalendarFold er As Outlook.MAPIFol der
Dim objAppointment As Outlook.Appoint mentItem

Set olApp = CreateObject("O utlook.Applicat ion")

olApp.GetNamesp ace("MAPI").Log on "Microsoft Outlook"

Set olNameSpace = olApp.GetNamesp ace("MAPI")

Set objCalendarFold er =
olNameSpace.Get DefaultFolder(o lFolderCalendar )
With objCalendarFold er.Items
Set objAppointment = .GetFirst
While Not objAppointment Is Nothing
Debug.Print "Subject=" & objAppointment. Subject & ",
StartTime=" & objAppointment. Start & ", Duration=" &
objAppointment. Duration
Set objAppointment = .GetNext
Wend
End With

Set objCalendarFold er = Nothing
Set olNameSpace = Nothing
Set olApp = Nothing
End Sub

Also, OutlookSpy is a great tool if you want to know all the details
of the Outlook objects.

-Tom.

"Tom van Stiphout" <no************ *@cox.net> schreef in bericht news:ok******** *************** *********@4ax.c om...

One option is to attach the data: Link Tables > Exchange.


Hi Tom,

I installed Outlook2003 and made a few Agenda entries.
I attached to the Agenda data with Link Tables > Exchange (same result for Link Tables > Outlook here)
All fine exect that the most important field aren't there ... ??
I see all kind of fields including subject, but NO fields for appointment date or appointment time ?????
This is crucial data for an appointment !!
Am I doing something very wrong here, or is MS doing something wrong ???

Testing:
When I export my agenda from Outlook to Access format, and link to the table Agenda in the created mdb then all the data I need is there.
However this method is not what I need.

Thanks,
Arno R


May 12 '06 #5

"Tom van Stiphout" <no************ *@cox.net> schreef in bericht news:23******** *************** *********@4ax.c om...
Here is a code fragment to get you started:

Public Sub ReadOutlook()
Dim olApp As Outlook.Applica tion
Dim olNameSpace As Outlook.NameSpa ce
Dim objCalendarFold er As Outlook.MAPIFol der
Dim objAppointment As Outlook.Appoint mentItem

Set olApp = CreateObject("O utlook.Applicat ion")

olApp.GetNamesp ace("MAPI").Log on "Microsoft Outlook"

Set olNameSpace = olApp.GetNamesp ace("MAPI")

Set objCalendarFold er =
olNameSpace.Get DefaultFolder(o lFolderCalendar )
With objCalendarFold er.Items
Set objAppointment = .GetFirst
While Not objAppointment Is Nothing
Debug.Print "Subject=" & objAppointment. Subject & ",
StartTime=" & objAppointment. Start & ", Duration=" &
objAppointment. Duration
Set objAppointment = .GetNext
Wend
End With

Set objCalendarFold er = Nothing
Set olNameSpace = Nothing
Set olApp = Nothing
End Sub

Also, OutlookSpy is a great tool if you want to know all the details
of the Outlook objects.

-Tom.



Thanks much Tom,

Your code errors at my place (at home) on the line
olApp.GetNamesp ace("MAPI").Log on "Microsoft Outlook"
If I comment this line out the code works.

Yesterday I came as far as this with similar code:
Sub TestAutomationO utlook()
On Error GoTo Err_OutL
Dim i As Integer
Dim objOutlook As Outlook.Applica tion
Dim nms As Outlook.NameSpa ce
Dim fld As Outlook.MAPIFol der
Dim itms As Outlook.Items
Set objOutlook = CreateObject("O utlook.applicat ion")
Set nms = objOutlook.GetN amespace("MAPI" )
Set fld = nms.folders("Pe rsoonlijke mappen").folder s("Agenda")
Set itms = fld.Items
For i = 1 To fld.Items.Count 'This is NOT zero-based ???
If DateValue(fld.I tems(i).Start) = Date Then
Debug.Print fld.Items(i).Su bject & "; " & fld.Items(i).St art & "; " & fld.Items(i).Du ration
End If
Next

CleanUp:
Set itms = Nothing
Set fld = Nothing
Set nms = Nothing
Set objOutlook = Nothing
Exit Sub

Err_OutL:
MsgBox Err & " " & Error$, vbCritical
Resume CleanUp
End Sub
I like your code better (more generic) so I will adapt it and add the DateValue restriction to get only the Items of today.

==> Next hurdle is to get at the shared folders.
Suppose I need the shared calendar for "MeetingRoo m1"
In what way do I need to change the codeline
Set objCalendarFold er =olNameSpace. . . . . . . . ??

Something like
Set objCalendarFold er =olNameSpace("S hared folders").folde rs("MeetingRoom 1") ??

(I can't test shared agenda's here at home, don't have exchange server here)

Thanks,
Arno R
May 12 '06 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1974
by: MLH | last post by:
I'm looking for Access Basic code I can use with Access 2.0 to automate sending email using Outlook Express. The body text will always be "Your invoice is attached." The Attachment control on the form in which you compose your email will get a different string value for each email, pointing to pdf file containing customer invoice (full path...
0
296
by: Lumpierbritches | last post by:
You used to be able to use SendObjects, but with the Security Updates to MS Wiindows, now it won't work. Is there a way to store information in the db and to automate outlook or outlook expess from within Access 97? or any other Access for that matter? Michael
3
1482
by: Lauren Wilson | last post by:
Hi folks, We have an Access 2000 app that is highly integrated with Outlook 2000 or later. The app allows the user to send predefined emails that are created through an Access form and stored in a table bound to that form. It all works great EXCEPT for one thing: Every time the user generates an email message to be placed into the...
1
2145
by: Richard | last post by:
All, I am writing an Outlook 2000 Add-In .DLL program. I have applied the necessary knowledge base fixes to enable event handling in Outlook 2000 and everything is working except for one thing: When I make changes to the items in a folder I get the ItemAdd() event and the ItemChange() event but I do not ever get the ItemRemove() event.
0
2063
by: rcoutts | last post by:
I have a custom Access database that is a bulk mailing program for my small business to send emails to my customers (not spam!). Before sending mail, I export a folder in Outlook to an Access MDB file and then open the custom database which runs a VB subroutine that iterates through the exported MDB file and loads in new Senders of email. ...
7
4917
by: John | last post by:
Hi I am using the following code to automate outlook from within MS Access; Dim O As Object O = CreateObject("Outlook.Application") The problem is that I am getting the following error on the second line; Automation error
2
1275
by: Randy Harris | last post by:
I have an A2K app that generates a mail message in Outlook. It properly fills in the To and CC lines in Outlook, but Outlook doesn't attempt to resolve the names until the user manually changes something. (The user has to manually edit something on both the To line and the CC line) Anyone know of a way to force Outlook to attempt to...
2
1359
by: evilbungle | last post by:
Hi, I have a form that automates an outlook e-mail, I can get the e-mail to send fine but now I need to try and change who the e-mail is from. (I have a group mailbox which I need the e-mail to go from rather than an individual.) Is there a keyword for the from line in an outlook mail? Here is the code I am using with my effort to...
0
1544
by: brossyg | last post by:
I have some VBA code that creates an email in Access and sends it from Outlook. It is based on a query with a list of email addresses. It sends the first email to Outlook and then I have to manually click the SEND button in Outlook ... and then the second email is sent to Outlook ... and so on... The list of email addresses is getting quite...
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7451
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7960
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6048
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3501
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.