Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Create outlook calendar item

Status
Not open for further replies.

ericbjr2

IS-IT--Management
Jan 8, 2006
6
US
I have a project tracking database, then I use outlook to schedule the orders in the tracking database I created. I was wondering if there is a way to create a calendar item using parameters already entered into the orders?
 
Maybe one of these?
Posting info from Access to Outlook Calendar
thread700-1110102
Access to Outlook automation
thread707-1167011
Adding appointments to Public Calendar in Outlook
thread333-1161222
Useing Access as a shared calendar through outlook
thread705-1142369
 
I get this error message when I try this...

Compile error:

User-defined type not defined

and VBS highlights ", myEvent As AppointmentItem"

I used:

Private Sub SetAlarms_Click()

Dim myOlApp As Object, myEvent As AppointmentItem
Dim nsNameSpace As NameSpace, myFolderCalendar As MAPIFolder

On Error GoTo err_Exit

Set myOlApp = CreateObject("Outlook.Application")
Set nsNameSpace = myOlApp.GetNamespace("MAPI")
Set myFolderCalendar = nsNameSpace.GetDefaultFolder(olFolderCalendar)

Set myEvent = myOlApp.CreateItem(olAppointmentItem)
myEvent.start = Date
myEvent.Subject = Me.ProjectName
myEvent.Save

Set myOlApp = Nothing
Set myEvent = Nothing
Set myFolderCalendar = Nothing

MsgBox ("Event created in your Outlook calendar.")

Exit Sub

err_Exit:

MsgBox ("Error " & Err.Number & ": " & Err.Description)

End Sub
 
I think you need a reference to the Microsoft Outlook X Object Library. (Tools -> References in the code window.)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top