7 replies
by akritzer
Ever find a solution to this???
email me!
by curtisadmin
by skelley
I tried the samething and looked at what it would take in VB (with little VB experience) to figure this out.
I ended up using AUTOIT..
I create what ever appointment I want.. in the CSV format..
Outlook is usally open.. I point to the calendar
I run a 'macro' from autoit..and it does the keystrokes and nouseclicks in Outlook..just as one would do in EXCEL.
Download/install.. to completion of macro.. under 1 hour
by kmcnutt
This should get you started. It will require you to use some VBA though.
This goes into a module.
Public Sub ToOutLookCalendar(ByVal Subject As String, ByVal EventStart As Date, ByVal EventEnd As Date)
On Error GoTo errTrap
Dim oApp As New Outlook.Application
Dim oCalendar As Outlook.MAPIFolder
Dim oNameSpace As Outlook.NameSpace
Set oNameSpace = oApp.GetNamespace("MAPI")
Set oCalendar = oNameSpace.GetDefaultFolder(olFolderCalendar)
With oCalendar.Items.Add(olAppointmentItem)
.AllDayEvent = True
.Subject = Subject
.Start = EventStart
.End = EventEnd
.ReminderSet = False
.Save
End With
Err_Exit:
Set oCalendar = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
Exit Sub
errTrap:
'Code to handle errors goes here
Resume Err_Exit
End Sub
Then this can go on your form:
Private Sub cmdOutlook_Click()
On Error GoTo errTrap
Dim oApp As New Outlook.Application
Dim oCalendar As Outlook.MAPIFolder
Dim oNameSpace As Outlook.NameSpace
Set oNameSpace = oApp.GetNamespace("MAPI")
Set oCalendar = oNameSpace.GetDefaultFolder(olFolderCalendar)
With oCalendar.Items.Add(olAppointmentItem)
.AllDayEvent = True
.Subject = Me.Summary ' Name of your field for the subject
.Start = Me.Begin ' name of your field for start time
.End = Me.End_Due_Date ' name of your field for start time
.ReminderSet = False
.Save
End With
Err_Exit:
Set oCalendar = Nothing
Set oNameSpace = Nothing
Set oApp = Nothing
Exit Sub
errTrap:
'Code to handle errors goes here
Resume Err_Exit
End Sub
Again this should get you started. There are other fields you can map, just search the help or google.
Oh, one last thing. Make sure you reference the Outlook Object Library under Tools;References in the VBA Editor. Just in case... You can bring up the VBA editor by pressing Alt+F11. Though if you didn't already know that, you probably won't want to mess with this.
Kevin
by nick.mosher
Kevin -
I appreciate your response. This was exactly what I was looking for. Now for a silly question. I'd like to map this to a different calendar in outlook other than the default. How would I change to code to do that?
Thanks, Nick
by acrich
I am trying to do the same thing, I try your code, unfortunly I dont see the information on th calendar. Beacause I have a french version of office I even tried the french version of the field but did not work either. In your is it working properly?
Thanks
I found a example on the Microsoft web site
http://www.microsoft.com/downloads/thankyou.aspx?familyId=78f8c61a-6b58-4091-92c8-8d727894c080&displayLang=en if it can help anyone
Alex
Alex
This discussion is closed to new replies.
Trending Software posts
Sort by Trending