none
Outlook 2010 freezes with my add-in when I change keyboard language RRS feed

  • Question

  • Hi! Outlook 2010 freezes with my add-in when I change keyboard language. I found this method and I think that contains bug (when I remove this method from add-in - Outlook doesn't freeze), but why? I don't understand. Could you tell me about the possible causes hang Outlook 2010 after changing keyboard language? Thank you for answers.

     private void addUpdateRDOAppoiment(KID_Conference conference, List<KID_Questions> questions, AppointmentItem appoiment, bool
     newAppoiment)
     {
      try
      {
      if(!newAppoiment)
      {
       appoiment.Delete();
      }
    
      newAppoiment = true;
      appoiment = Application.CreateItem(OlItemType.olAppointmentItem) as
     Outlook.AppointmentItem;
    
      appoiment.Start = conference.Plbegin_date;
      appoiment.End = conference.Plend_date;
      appoiment.Location = conference.Room.Room_name;
      appoiment.ReminderMinutesBeforeStart = 15;
    
      appoiment.Subject = conference.ConferenceName;
      appoiment.Categories = categoryName;
    
      if
     (newAppoiment)
      {
       appoiment.UserProperties.Add("AppoimentID"
    , OlUserPropertyType.olText, true
    , OlUserPropertyType.olText);
       appoiment.UserProperties["AppoimentID"
    ].Value = conference.Id.ToString();
      }
    
      for
     (int
     i = 0; i < conference.Members.Count; i++)
      {
       if
     (conference.Members[i].Email != ""
    )
       {
       appoiment.Recipients.Add(conference.Members[i].Email);
       }
       else
    
       appoiment.Recipients.Add(conference.Members[i].RuSurName + " "
     + conference.Members[i].RuName);
      }
    
    
      System.Collections.IEnumerator recipEnumerator = appoiment.Recipients.GetEnumerator();
      while
     (recipEnumerator.MoveNext())
      {
       Recipient oRec = (Recipient)recipEnumerator.Current;
       oRec.Resolve();
      }
    
      RTFBuilderbase sb = new
     RTFBuilder();
      for
     (int
     i = 0; i < questions.Count; i++)
      {
       try
    
       {
       string
     link = kidProtocol + questions[i].Id;
       System.Drawing.Font font = new
     System.Drawing.Font(new
     System.Drawing.FontFamily("Arial"
    ), 10);
       sb.Font(RTFFont.Arial);
       TextTools.WriteLineWithHeaderAndText(sb, "Ссылка на вопрос: "
    , link);
    
       TextTools.WriteLineWithHeaderAndText(sb, "Статус: "
    , questions[i].Status.Name);
       TextTools.WriteLineWithHeaderAndText(sb, "Формулировка: "
    , questions[i].Formulating);
    
       TextTools.WriteLineWithHeaderAndRtf(sb, "Информация к вопросу: "
    ,
        TextTools.GetRtfWithSelectFont(questions[i].InformationForQuestion, font));
    
       TextTools.WriteLineWithHeaderAndText(sb, "Решение: "
    , questions[i].Resolution);
    
       TextTools.WriteLineWithHeaderAndRtf(sb, "Информация к решению: "
    ,
        TextTools.GetRtfWithSelectFont(questions[i].InformationForResolution, font));
       sb.AppendLine();
       sb.AppendLine("<=======================================================>"
    );
       sb.AppendLine();
       }
       catch
     (System.Exception ex)
       {
    
       }
      }
      string
     newRTF = TextTools.ReplaceLinksRTF(sb.ToString());
    
      appoiment.RTFBody = TextTools.StrToByteArray(newRTF);
      appoiment.Save();
      System.Runtime.InteropServices.Marshal.ReleaseComObject(appoiment);
      }
      catch
     (System.Exception exc)
      {
      }
     }
    

    Thursday, March 10, 2011 1:59 PM

All replies