Retrieving client account properties for data processing
Hi guys,
I have a company project I need completed and I am very new to network VB programming and could use help. I have been given an already existing company ASP Annual Leave system from which I need to add classes involving Outlook Calendar Automation. I have already designed/tested the Outlook Automation code on a local, non-server level and it worked fine. My challenge is tweaking that code to retrieve a specific account detail from a company user who has requested A/L via the system and approved by manager. I understand this sounds very complex and may take time and alot of replies to get sorted but I'd be grateful for your help. One class code I have for Outlook Automation is adding calendar appointments as shown below:
Code:
Public Sub AddOutlookAppointment()
Dim oOutlook As New Outlook.Application
Dim oOutlookNamespace As Microsoft.Office.Interop.Outlook.NameSpace = oOutlook.GetNamespace("MAPI")
Dim oAppItem As Outlook.AppointmentItem = oOutlook.CreateItem(OlItemType.olAppointmentItem)
Dim startDate As Date = CDate(StartDate1.Text)
Dim endDate As Date = CDate(EndDate1.Text)
oAppItem.Subject = "Annual Leave"
oAppItem.Start = startDate
oAppItem.End = endDate
oAppItem.ReminderSet = True
oAppItem.BusyStatus = Outlook.OlBusyStatus.olOutOfOffice
Marshal.FinalReleaseComObject(oOutlookNamespace)
oOutlookNamespace = Nothing
oAppItem.Save()
Marshal.FinalReleaseComObject(oAppItem)
oAppItem = Nothing
oOutlook.Quit()
Marshal.FinalReleaseComObject(oOutlook)
oOutlook = Nothing
'Cleanup
GC.Collect()
GC.WaitForPendingFinalizers()
GC.Collect()
GC.WaitForPendingFinalizers()
End Sub
Thanks.