Re: Create a meeting request using VBA

C

Cheryl Fischer

Here is a bit of sample code to get you started. It presumes that you'll
be running it from a command button on a form. Note that you will need to
set a reference to the Microsoft Outlook xx.x Object Library (where xx.x is
the Outlook version you are using).

Dim objOApp As New Outlook.Application
Dim objAppt As AppointmentItem
Dim oExp As Outlook.Explorer


Set objOApp = New Outlook.Application
Set objAppt = objOApp.CreateItem(olAppointmentItem)
Set oExp = objOApp.Session.GetDefaultFolder(olFolderInbox).GetExplorer

With objAppt
.RequiredAttendees = "Addressee(s) Name(s)"
.Subject = "Subject of Meeting/Appointment"
.Importance = 2 ' high
.Start = YourDateField & " " & IIf(IsNull(YourTimeField), " 8:00",
YourTimeField)
.Location = "Location of Meeting"
.Body = "Additional information to appear in body"
.MeetingStatus = 1
.ResponseRequested = True
'.Save 'Uncomment if you want message saved to your sent items
folder
.Send
MsgBox "Item sent."
End With


Exit_btnSendItem_Click:
Set objOApp = Nothing
Set objAppt = Nothing
Set oExp = Nothing
Exit Sub

I got a lot of it from "Outlook 2000 VBA" by Dwayne Gifford (Wrox Pub.)
For additional information, browse the excellent website:
http://www.slipstick.com
 
B

Billy

Thanks very much Cheryl!!
Appreciate it!
-----Original Message-----
Here is a bit of sample code to get you started. It presumes that you'll
be running it from a command button on a form. Note that you will need to
set a reference to the Microsoft Outlook xx.x Object Library (where xx.x is
the Outlook version you are using).

Dim objOApp As New Outlook.Application
Dim objAppt As AppointmentItem
Dim oExp As Outlook.Explorer


Set objOApp = New Outlook.Application
Set objAppt = objOApp.CreateItem(olAppointmentItem)
Set oExp = objOApp.Session.GetDefaultFolder (olFolderInbox).GetExplorer

With objAppt
.RequiredAttendees = "Addressee(s) Name(s)"
.Subject = "Subject of Meeting/Appointment"
.Importance = 2 ' high
.Start = YourDateField & " " & IIf(IsNull (YourTimeField), " 8:00",
YourTimeField)
.Location = "Location of Meeting"
.Body = "Additional information to appear in body"
.MeetingStatus = 1
.ResponseRequested = True
'.Save 'Uncomment if you want message saved to your sent items
folder
.Send
MsgBox "Item sent."
End With


Exit_btnSendItem_Click:
Set objOApp = Nothing
Set objAppt = Nothing
Set oExp = Nothing
Exit Sub

I got a lot of it from "Outlook 2000 VBA" by Dwayne Gifford (Wrox Pub.)
For additional information, browse the excellent website:
http://www.slipstick.com

--
Cheryl Fischer
Law/Sys Associates
Houston, TX




.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top