Calendars in PST are not readable in Outlook but its showing in other tools like Aspose PST Viewer

PST exported by Aspose.Email which also has the calendars that are not readable in Outlook but other tools like Aspose pst viewer are showing correctly

@vaibhav007

I suggest you to please try using latest Aspose.Email for .NET 20.8. In case there is an issue then please share the used sample code, source PST, generated PST and snapshot of issue incurring in MS Outlook along with Outlook version.

i have tried with latest 20.8 having same issue and pst uploaded plz do check

mamaphoto24@gmail.com.zip (12.8 KB)

                    Appointment appointment = Appointment.Load(p_AppointmentObj.ICSPath);
                    MailMessage mailMsg = new MailMessage();
                    mailMsg.AddAlternateView(appointment.RequestApointment());
                    MapiMessage mapiMsg = MapiMessage.FromMailMessage(mailMsg);

                    f_FolderInfoObj.AddMessage(mapiMsg);

@vaibhav007

As requested earlier, please provide following information too.

mamaphoto24@gmail.com.zip (12.8 KB)
outlook snapshot.png (140.0 KB)

Snapshot and outlook pst provided

@vaibhav007

I have opened a ticket with ID EMAILNET-39939 in our issue tracking system to further investigate and resolve the issue. This thread has been linked with the issue so that you may be notified once the issue will be fixed.

1 Like

@vaibhav007

We have tried to verify this case and could not reproduce this on our end. We have used the following code sample:

using (PersonalStorage pst = PersonalStorage.Create(@"test.pst", FileFormatVersion.Unicode))
{
    FolderInfo calendarFolder = pst.CreatePredefinedFolder("Calendar", StandardIpmFolder.Appointments);

    Appointment appointment = Appointment.Load(@"Appointment.ics");
    MailMessage mailMsg = new MailMessage();
    mailMsg.AddAlternateView(appointment.RequestApointment());
    MapiMessage mapiMsg = MapiMessage.FromMailMessage(mailMsg);

    calendarFolder.AddMessage(mapiMsg);
}

Can you please share the following:

  • How did you create a PST?
  • Does the result depend on a specific appointment or on all?

result does not depend on a specific appointment or on all having issue for all
following code for pst creation

 Aspose.Email.Calendar.Appointment appointment = Aspose.Email.Calendar.
                                                                    Appointment.Load(p_AppointmentObj.ICSPath);
                    Aspose.Email.MailMessage mailMsg = new Aspose.Email.MailMessage();
                    mailMsg.AddAlternateView(appointment.RequestApointment());
                    Aspose.Email.Mapi.MapiMessage mapiMsg = Aspose.Email.Mapi.MapiMessage.
                        FromMailMessage(mailMsg);


                    f_FolderInfoObj.AddMessage(mapiMsg);

@vaibhav007

I have included the feedback in our issue tracking system and we will share the feedback with you as soon as it will be shared.

1 Like

any update on this issue?

@vaibhav007

Unfortunately, we still cannot reproduce the bug. Can you please send a sample appointment file that you have in the example? Also, it is important for us to know what program is used to create the original PST (Outlook or not) and also is the f_FolderInfoObj folder (in example) a calendar folder?

Following code for pst creation

  private bool CreatePST(string p_filePath, Mode p_PSTFileMode)
    {
        string METHOD_NAME = "createPST";
        bool f_IsSuccessfull = false;


        try
        {

            if (String.IsNullOrEmpty(p_filePath))
            {
                m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " PST file path is empty while creating a file.");
                return false;
            }
            if (p_PSTFileMode == Mode.CREATE)
            {

                String tempFilepath = p_filePath;

                int count = 1;
                while (File.Exists(tempFilepath))
                {
                    tempFilepath = p_filePath.Substring(0, p_filePath.LastIndexOf('.')) + " (" + count++ + ").pst";
                }

                m_ObjPersonalStorage = PersonalStorage.Create(tempFilepath, FileFormatVersion.Unicode);   // if file estist then it gives a error.
                // PersonalStorage pst = PersonalStorage.Create(@"TestSubject1.pst", FileFormatVersion.Unicode);
                f_IsSuccessfull = true;
                m_pstFileName = tempFilepath;
                m_pstFileNAME = tempFilepath;

                #region Pre Defined Folders
                try
                {
                    if (m_ObjPersonalStorage != null)
                    {
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Contacts", StandardIpmFolder.Contacts);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);
                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Calender", StandardIpmFolder.Appointments);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);
                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Tasks", StandardIpmFolder.Tasks);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);
                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Notes", StandardIpmFolder.Notes);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);
                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Journal", StandardIpmFolder.Journal);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Drafts", StandardIpmFolder.Drafts);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Inbox", StandardIpmFolder.Inbox);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Outbox", StandardIpmFolder.Outbox);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                        }
                        try
                        {
                            m_ObjPersonalStorage.CreatePredefinedFolder("Sent Items", StandardIpmFolder.SentItems);
                        }
                        catch (Exception objEx)
                        {
                            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                        }
                    }
                }
                catch (Exception objEx)
                {
                    m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating PredefinedFolder in " + p_filePath + " due to :- " + objEx.Message);

                }
                #endregion

                f_IsSuccessfull = true;
                m_pstFileName = p_filePath;
                m_ObjPersonalStorage.Store.ChangeDisplayName(Path.GetFileNameWithoutExtension(p_filePath));
                //  m_ObjPersonalStorage.DisplayName = Path.GetFileNameWithoutExtension(p_filePath);


            }
            else
            {
                m_ObjPersonalStorage = PersonalStorage.FromFile(p_filePath);
                f_IsSuccessfull = true;
                m_pstFileName = p_filePath;
            }
        }
        catch (IOException ex)
        {
            if (ex.Message.Contains("There is not enough space on the disk"))
            {
                RaiseOnExportDriveFull();
                // Release();
            }
            else
            {
                m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating file " + p_filePath + " due to :- " + ex.Message);
                f_IsSuccessfull = false;
            }
            f_IsSuccessfull = false;
        }
        catch (Exception ex)
        {
            m_objLogFile.LogError(CLASS_NAME, METHOD_NAME, " Error while creating file " + p_filePath + " due to :- " + ex.Message);
            f_IsSuccessfull = false;
        }

        return f_IsSuccessfull;
    }

mamaphoto24@gmail.com.zip (13.4 KB)

ics file

@vaibhav007

I have linked the information in our issue tracking system and we will share the feedback with you as soon as the issue will be addressed.

1 Like

any update on this issue?

@vaibhav007

I regret to share that at present there are no updates. We will share the feedback with you as soon as the issue will be addressed.

1 Like

any update on this issue?

@vaibhav007

We have tried to work further but still cannot reproduce the issue with the ICS file provided by you using Aspose.Email for .NET 20.12 on your end. We have tried following sample code and also snapshot is attached for your convenience.

using (PersonalStorage pst = CreatePST(@"mamaphoto24@gmail.com.pst"))
{
    FolderInfo calendarFolder = pst.GetPredefinedFolder(StandardIpmFolder.Appointments);
    CalendarReader reader = new CalendarReader(@"mamaphoto24@gmail.com.ics");

    while (reader.NextEvent())
    {
        Appointment appointment = reader.Current;
        MailMessage mailMsg = new MailMessage();
        mailMsg.AddAlternateView(appointment.RequestApointment());
        MapiMessage mapiMsg = MapiMessage.FromMailMessage(mailMsg);

        calendarFolder.AddMessage(mapiMsg);
    }
}

screenshot.png (59.2 KB)

ok i’ll try and get back to you

@vaibhav007

Thank you for your understanding.