none
Sending Outlook 2007 Meeting Request from ASP.NET Web Apps

    Question

  • I've been trying to send an Outlook Meeting request from a custom ASP.NET Web application.  We are on a single Exchange server environment - I've tried many different methods that are not working...for instance:

     

    Imports Outlook = Microsoft.Office.Interop.Outlook

     

    Private Sub Meeting()

     Dim arrivald As Date = CALLArrival.SelectedDate.ToShortDateString & " " & ddlarrivaltime.SelectedItem.Text & " " & ddlarrivalpm.SelectedItem.Text

     Dim departured As Date = CALLDeparture.SelectedDate.ToShortDateString & " " & ddlDEPARTURETime.SelectedItem.Text & " " & ddlDeparturePM.SelectedItem.Text

    ' Dim usern As String = User.Identity.Name()

    ' Dim oApp As Outlook.Application = New Outlook.Application

    ' Dim Appt As Outlook._AppointmentItem = oApp.CreateItem(Outlook.OlItemType.olAppointmentItem)

    ' Appt.MeetingStatus = Outlook.OlMeetingStatus.olMeeting

    ' appt.Location = "Operations"

    ' appt.Start = arrivald

    ' appt.End = departured

    ' Dim recipRequired As Outlook.Recipient = appt.Recipients.Add(email@gmail.com)

    ' recipRequired.Type = Outlook.OlMeetingRecipientType.olRequired

    ' appt.Recipients.ResolveAll()

    ' appt.Send()

    ' appt.Display(False)

    'End Sub

     

    Any help would be appreciated - I'm not really sure what direction to go to get this working!

    Tuesday, September 04, 2007 4:43 PM

All replies

  • Hi,

    You can use below code for generating calendar.

    Public Sub ICal()

            Dim filepath As String = ConfigurationManager.AppSettings("FilePath")
            Dim schLocation As String = "Travel"
            Dim schSubject As String = "Business visit discussion"
            Dim schBeginDate As DateTime = Convert.ToDateTime("7/3/2008 10:00:00 PM")
            Dim schEndDate As DateTime = Convert.ToDateTime("7/3/2008 11:00:00 PM")
            Dim schDescription As String = "Description"
            Dim contents As String() = {"BEGIN:VCALENDAR", "PRODID:-//Flo Inc.//FloSoft//EN", "BEGIN:VEVENT", "DTSTART:" + schBeginDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), "DTEND:" + schEndDate.ToUniversalTime().ToString("yyyyMMdd\\THHmmss\\Z"), "LOCATION:" + schLocation, "DESCRIPTION;ENCODING=QUOTED-PRINTABLE:" + schDescription, "SUMMARY:" + schSubject, "PRIORITY:3", "END:VEVENT", "END:VCALENDAR"}

            System.IO.File.WriteAllLines("C:\TRError\Sample.ics", contents)

            SendMailAttachment("C:\TRError\Sample.ics")


        End Sub

    Tuesday, June 05, 2012 6:07 PM
  • Unfortunately Outlook (Actually all Office Products) are not not designed for the server side automation like using it inside ASPX pages. There are many known issues associated with it and you will be able to get the details in the following article:

    Considerations for server-side Automation of Office
    http://support.microsoft.com/default.aspx?scid=KB;EN-US;257757

    Therefore I would strongly suggest you not to use Outlook Object Model for sending a meeting request from your web application as it is not supported and you are bound to face issues with it.

    In case you are using Exchange then the best alternative for you is, to use the Exchange Web Services (EWS) Managed API.

    Following article explains how you can send a meeting invite using EWS:

    Creating appointments and meetings by using the EWS Managed API
    http://msdn.microsoft.com/en-us/library/dd633661(EXCHG.80).aspx

    I hope that this information helps you. Do let me know if you have any other queries.

    Regards,

    Shailesh Rajput



    Friday, June 08, 2012 10:26 PM