EDN Admin
Well-known member
Hey all,
Im trying to write a program that will accept data and create a calendar appointment out of it. I have it working for my own calendar, but I cant figure out how to get it working for a shared calendar. Here is the code:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Public <span style="color:Blue; Class LoanerBlackberryAssistant
<span style="color:Blue; Private <span style="color:Blue; Sub btnEnterDate_Click(<span style="color:Blue; ByVal sender <span style="color:Blue; As System.Object, <span style="color:Blue; ByVal e <span style="color:Blue; As System.EventArgs) <span style="color:Blue; Handles btnEnterDate.Click
<span style="color:Green; Starts Outlook
<span style="color:Blue; Dim olApp <span style="color:Blue; As Outlook.Application
olApp = CreateObject(<span style="color:#A31515; "Outlook.Application")
<span style="color:Green; Gets NameSpace and Logon
<span style="color:Blue; Dim olNs <span style="color:Blue; As Outlook.<span style="color:Blue; NameSpace
olNs = olApp.GetNamespace(<span style="color:#A31515; "MAPI")
olNs.Logon()
<span style="color:Blue; Dim strUserName <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strBlackberryNumber <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strAssignmentDate <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strExpectedReturnDate <span style="color:Blue; As <span style="color:Blue; String
strUserName = <span style="color:Blue; Me.txtUserName.Text
strBlackberryNumber = <span style="color:Blue; Me.txtBlackberryNumber.Text
strAssignmentDate = <span style="color:Blue; Me.txtAssignmentDate.Text
strExpectedReturnDate = <span style="color:Blue; Me.txtExpectedReturnDate.Text
<span style="color:Green; Prepare an appointment
<span style="color:Blue; Dim oApp <span style="color:Blue; As Outlook.Application = <span style="color:Blue; New Outlook.Application()
<span style="color:Green; Create a new AppointmentItem.
<span style="color:Blue; Dim oAppt <span style="color:Blue; As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
<span style="color:Green; Set some common properties.
oAppt.Subject = strUserName
oAppt.Body = strUserName
oAppt.Location = strBlackberryNumber
oAppt.Start = Convert.ToDateTime(strAssignmentDate)
oAppt.<span style="color:Blue; End = Convert.ToDateTime(strExpectedReturnDate)
oAppt.ReminderSet = <span style="color:Blue; True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy
oAppt.IsOnlineMeeting = <span style="color:Blue; False
<span style="color:Green; Save to Calendar.
oAppt.Save()
<span style="color:Green; Clean up.
oApp = <span style="color:Blue; Nothing
oAppt = <span style="color:Blue; Nothing
<span style="color:Blue; End <span style="color:Blue; Sub
[/code]
Thanks for any help
View the full article
Im trying to write a program that will accept data and create a calendar appointment out of it. I have it working for my own calendar, but I cant figure out how to get it working for a shared calendar. Here is the code:
<div style="color:Black;background-color:White; <pre>
<span style="color:Blue; Public <span style="color:Blue; Class LoanerBlackberryAssistant
<span style="color:Blue; Private <span style="color:Blue; Sub btnEnterDate_Click(<span style="color:Blue; ByVal sender <span style="color:Blue; As System.Object, <span style="color:Blue; ByVal e <span style="color:Blue; As System.EventArgs) <span style="color:Blue; Handles btnEnterDate.Click
<span style="color:Green; Starts Outlook
<span style="color:Blue; Dim olApp <span style="color:Blue; As Outlook.Application
olApp = CreateObject(<span style="color:#A31515; "Outlook.Application")
<span style="color:Green; Gets NameSpace and Logon
<span style="color:Blue; Dim olNs <span style="color:Blue; As Outlook.<span style="color:Blue; NameSpace
olNs = olApp.GetNamespace(<span style="color:#A31515; "MAPI")
olNs.Logon()
<span style="color:Blue; Dim strUserName <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strBlackberryNumber <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strAssignmentDate <span style="color:Blue; As <span style="color:Blue; String
<span style="color:Blue; Dim strExpectedReturnDate <span style="color:Blue; As <span style="color:Blue; String
strUserName = <span style="color:Blue; Me.txtUserName.Text
strBlackberryNumber = <span style="color:Blue; Me.txtBlackberryNumber.Text
strAssignmentDate = <span style="color:Blue; Me.txtAssignmentDate.Text
strExpectedReturnDate = <span style="color:Blue; Me.txtExpectedReturnDate.Text
<span style="color:Green; Prepare an appointment
<span style="color:Blue; Dim oApp <span style="color:Blue; As Outlook.Application = <span style="color:Blue; New Outlook.Application()
<span style="color:Green; Create a new AppointmentItem.
<span style="color:Blue; Dim oAppt <span style="color:Blue; As Outlook.AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)
<span style="color:Green; Set some common properties.
oAppt.Subject = strUserName
oAppt.Body = strUserName
oAppt.Location = strBlackberryNumber
oAppt.Start = Convert.ToDateTime(strAssignmentDate)
oAppt.<span style="color:Blue; End = Convert.ToDateTime(strExpectedReturnDate)
oAppt.ReminderSet = <span style="color:Blue; True
oAppt.ReminderMinutesBeforeStart = 5
oAppt.BusyStatus = Outlook.OlBusyStatus.olBusy
oAppt.IsOnlineMeeting = <span style="color:Blue; False
<span style="color:Green; Save to Calendar.
oAppt.Save()
<span style="color:Green; Clean up.
oApp = <span style="color:Blue; Nothing
oAppt = <span style="color:Blue; Nothing
<span style="color:Blue; End <span style="color:Blue; Sub
[/code]
Thanks for any help
View the full article