错误:在Outlook中选择约会时,没有内存或磁盘空间来完成操作。 [英] ERROR: There is not enought memory or disk space to complete the operation, when selecting an appointment in Outlook.
问题描述
 
您好
Hi
我添加了一段代码,添加了一个新约会并添加了hiperlinks到约会,它工作正常(它成功发送约会)但当我单击Outlook 2013中的约会我收到一条错误消息:"没有内存或
磁盘空间来完成操作"。
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".
- 是一个Silverlight 5项目。
- Is a silverlight 5 project.
- 我正在使用Visual Studio 2015 Professional。
- Im using Visual Studio 2015 Professional.
- 我正在使用Outlook 2017,Windows 10 64位。
- 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.
你能帮我吗?
这是我正在使用的一段代码:
This is the piece of code that I'm using:
使用(var client = AutomationFactory) .CreateObject(" Outlook.Application"))
{
                   使用(VAR outlookAppointment = client.CreateItem(olAppointmentItem))
                     {
                    &NBSP ;   VAR olCalendarItems = client.Session.GetDefaultFolder(olFolderCalendar);
                        对象缺失= Type.Missing;
;         对象strLink = appoinmentVar.HyperLink;
                 &NBSP ;      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(在appoinmentVar.Recipients VAR电子邮件)
                &NBSP ;       {
                    &NBSP ;       outlookAppointment.Recipients.Add(电子邮件);
                &NBSP ;       }
                    &NBSP ;   outlookAppointment.ReminderMinutesBeforeStart = 15;
      outlookAppointment.ReminderSet = TRUE;
                         outlookAppointment.MeetingStatus = olMeeting;
$
          var objInsp = outlookAppointment.GetInspector;
      VAR objDoc = objInsp.WordEditor;
                 &NBSP ;      var objSel = objDoc.Windows [1] .Selection;
             objDoc.Content.Hyperlinks.Add(objSel.Range,ref strLink,ref missing,ref missing,ref strLinkText,ref missing);
                     //显示会议项目。
      outlookAppointment.Display(true);
$
  ;          outlookAppointment.Save();
                         outlookAppointment.Send();
                     }
}
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.Recipients.Add(email);
}
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.
outlookAppointment.Display(true);
outlookAppointment.Save();
outlookAppointment.Send();
}
}
推荐答案
Hello Robert,
Hello Robert,
我建议立即从发布底层COM对象开始在代码中。 使用 System.Runtime.InteropServices.Marshal。 ReleaseComObject 到
完成使用后释放Outlook对象。然后s et a variable to 没什么   ;在
Visual Basic中( null 在
C#中)释放对象的引用。了解更多关于,在  系统释放对象 文章。
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.
> - 是一个Silverlight 5项目。
> - Is a silverlight 5 project.
您是否有机会运行代码示例Windows窗体应用程序?它是否正常工作?
微软目前不推荐,也没有
支持,从任何无人参与的非交互式客户端应用程序或组件(包括ASP,ASP.NET,DCOM和NT服务)自动化Microsoft Office应用程序,因为Office在运行Office时可能会出现不稳定的行为和/或死锁在这个
环境中。
如果您正在构建一个在服务器端上下文中运行的解决方案,您应该尝试使用
的组件为无人值守的执行安全。或者,您应该尝试找到替代方案允许至少部分代码在客户端运行。如果从服务器端解决方案使用Office应用程序,应用程序将缺少许多必要的功能
才能成功运行。此外,您将承担风险整体解决方案的稳定性。在 注意事项
用于服务器端自动化Office
这篇关于错误:在Outlook中选择约会时,没有内存或磁盘空间来完成操作。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!