I have created an asp.net project that exports items from datagridview to and outlook calendar
This is the code that i have used..
Expand|Select|Wrap|Line Numbers
- Dim body As String
- Dim ends As String
- Dim location As String
- Dim start As String
- Dim subject As String
- 'Create an outlook application
- Dim oApp As Microsoft.Office.Interop.Outlook.Application
- oApp = New Microsoft.Office.Interop.Outlook.Application()
- 'Get Namespace and Logon
- Dim oNS As Microsoft.Office.Interop.Outlook.NameSpace = oApp.GetNamespace("mapi")
- 'Create a new appointment
- Dim oAppt As Microsoft.Office.Interop.Outlook.AppointmentItem
- For Each row As GridViewRow In GridView3.Rows
- oNS.Logon("YourValidProfile", Missing.Value, False, True) 'todo:
- oAppt = oApp.CreateItem(OlItemType.olAppointmentItem)
- body = row.Cells(0).Text
- ends = row.Cells(1).Text
- location = row.Cells(2).Text
- start = row.Cells(3).Text
- subject = row.Cells(4).Text
- oAppt.Subject = subject
- oAppt.Body = body
- oAppt.Location = location
- oAppt.Start = start
- oAppt.End = ends
- oAppt.Save()
- oNS.Logoff()
- Next
Could not load file or assembly 'Microsoft.Office.Interop.Outlook, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.
I have loaded the PIA's on the server itself and have checked the C:\Windows\Assembly folder and the Microsoft.Office.Interop.Outlook assembly is within that folder and the version is 12.0.0.0
Can anyone direct to a solution if possible please.