Outlook Appointment in Visual Basic - is it possible to do?

  • Thread starter Thread starter Kamyk
  • Start date Start date
K

Kamyk

Hello all!

I have the following problem. I know how to create a mail in VB with a
subject and people to send, but is it possible to create an Outlook
appointment in VB, if it is possible, please be so kind and give me some
example?

Thank you in advance
Marcin from Poland
 
Hi,
Here is a sample.

Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Dim olItems As Outlook.Items
Dim olAppt As Outlook.AppointmentItem

Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olItems = olFolder.Items
Set olAppt = olItems.Add
With olAppt
.Start = "09-01-04 8:30 AM"
.End = "09-01-04 9:30 AM"
.Subject = "hi there"
.ReminderMinutesBeforeStart = "15"
.Save
End With


As usual, don't forget to 'Set' any objects you create to 'Nothing'!!
 
U¿ytkownik "Dan Artuso said:
Hi,
Here is a sample.

Dim olApp As Outlook.Application
Dim olNS As Outlook.NameSpace
Dim olFolder As Outlook.MAPIFolder
Dim olItems As Outlook.Items
Dim olAppt As Outlook.AppointmentItem

Set olApp = New Outlook.Application
Set olNS = olApp.GetNamespace("MAPI")
Set olFolder = olNS.GetDefaultFolder(olFolderCalendar)
Set olItems = olFolder.Items
Set olAppt = olItems.Add
With olAppt
.Start = "09-01-04 8:30 AM"
.End = "09-01-04 9:30 AM"
.Subject = "hi there"
.ReminderMinutesBeforeStart = "15"
.Save
End With

Thank you a lot.
I will try it out

Regards
Marcin / Poland
Tyco Electronics Poland
 
Dan,

This code is working very well for me. Thanks for the tip. The only
problem I am having is trying to turn the reminder on. The following
does not seem to work:

..ReminderSet = True

The reminder checkbox in Outlook is not checked using this command.

My environment:
Access 2000 - SP3
Outlook 2000 - SP3

Thanks,
Barry
 
Nevermind!

Not being that familiar with Outlook, I now realize that the checkbox
does not have to be checked for the reminder to work. It is only used
to allow you to change the reminder time.

Sorry for the misleading post.

Barry
 
Back
Top