ERROR: There is not enought memory or disk space to complete the operation, when selecting an appointment in Outlook. RRS feed

  • Question



    I added a piece of code that adds a new appointment and add hiperlinks to the appointment, It works fine (it sends the appointment sucessfully) but when i click the appointment in outlook 2013 i got an error that says: "There is not enought memory or disk space to complete the operation".

    - Is a silverlight 5 project.

    - Im using Visual Studio 2015 Professional.

    - Im using Outlook 2017, Windows 10 64 bits.

    - It sends the error message just when adding the hyperlink, if i comment that part it works fine.

    Could you help me please?

    This is the piece of code that I'm using:

    using (var client = AutomationFactory.CreateObject("Outlook.Application"))
                        using (var outlookAppointment = client.CreateItem(olAppointmentItem))
                            var olCalendarItems = client.Session.GetDefaultFolder(olFolderCalendar);

                            object missing = Type.Missing;

                            object strLink = appoinmentVar.HyperLink;
                            object strLinkText = appoinmentVar.HyperLinkText;

                            outlookAppointment.Start = appoinmentVar.StartDate;
                            outlookAppointment.End = appoinmentVar.EndDate;
                            outlookAppointment.Subject = appoinmentVar.Subject;
                            outlookAppointment.Body = appoinmentVar.Body;
                            outlookAppointment.Location = appoinmentVar.Location;
                            foreach (var email in appoinmentVar.Recipients)
                            outlookAppointment.ReminderMinutesBeforeStart = 15;
                            outlookAppointment.ReminderSet = true;
                            outlookAppointment.MeetingStatus = olMeeting;

                            var objInsp = outlookAppointment.GetInspector;                      
                            var objDoc = objInsp.WordEditor;
                            var objSel = objDoc.Windows[1].Selection;

                            objDoc.Content.Hyperlinks.Add(objSel.Range, ref strLink, ref missing, ref missing, ref strLinkText, ref missing);

                            //Display meeting item.


    Thursday, June 22, 2017 4:43 PM

All replies

  • Hello Robert,

    I'd suggest starting from releasing underlying COM objects instantly in the code. Use System.Runtime.InteropServices.Marshal.ReleaseComObject to release an Outlook object when you have finished using it. Then set a variable to Nothing in Visual Basic (null in C#) to release the reference to the object. Read more about that in the Systematically Releasing Objects article. 

    - Is a silverlight 5 project.

    Did you have a chance to run the code from a sample Windows Forms application? Does it work correctly?

    Microsoft does not currently recommend, and does not support, Automation of Microsoft Office applications from any unattended, non-interactive client application or component (including ASP, ASP.NET, DCOM, and NT Services), because Office may exhibit unstable behavior and/or deadlock when Office is run in this environment.

    If you are building a solution that runs in a server-side context, you should try to use components that have been made safe for unattended execution. Or, you should try to find alternatives that allow at least part of the code to run client-side. If you use an Office application from a server-side solution, the application will lack many of the necessary capabilities to run successfully. Additionally, you will be taking risks with the stability of your overall solution. Read more about that in the Considerations for server-side Automation of Office article. 

    profile for Eugene Astafiev at Stack Overflow, Q&A for professional and enthusiast programmers

    Thursday, June 22, 2017 9:30 PM