0

At work, we have a custom form to submit PostItems in Public Folder. Because they're in custom form and fields, I can't get them through ExtendedProperties. Every time I try to do that, the ExtendedProperties.Count == 0.

I've seen so many links, but for some reason, they're provided with GUID that doesn't make sense (As in, where did they get that GUID!?), and they're more revolved around Contacts and Calendars, but not PostItems.

The custom fields/columns are stored in an ItemClass called "IPM.Post.Special_Department_INBOX"

Links of examples I've looked at:

If it helps, this is the code:

public class PublicFolder
{
    public string DisplayName { get; set; }
    public FolderId FolderID { get; set; }
    public int Childs { get; set; }
}


private void DoMagic()
{    
    try
    {
        List<PublicFolder> RootFolders = new List<PublicFolder>();
        ExchangeService ES = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
        try
        {
            ES.Credentials = new WebCredentials("email@domain.com", "password");
            ES.AutodiscoverUrl("email@domain.com");
            Folder F = Folder.Bind(ES, WellKnownFolderName.PublicFoldersRoot);
            F.Load();
            foreach (Folder fol in F.FindFolders(new FolderView(F.ChildFolderCount)))
            {
                PublicFolder PF = new PublicFolder();
                PF.DisplayName = fol.DisplayName;
                PF.Childs = fol.ChildFolderCount;
                PF.FolderID = fol.Id;
                RootFolders.Add(PF);
            }
            foreach (PublicFolder PF in RootFolders)
            {
                Folder Q = Folder.Bind(ES, PF.FolderID);
                {
                    if (Q.ChildFolderCount > 0)
                    {
                        Q.Load();
                        if (Q.DisplayName == "Special Department's Folder")
                        {
                            foreach (Folder W in Q.FindFolders(new FolderView(Q.ChildFolderCount)))
                            {
                                if (W.DisplayName == "Inbox Folder")
                                {
                                    Folder R = Folder.Bind(ES, W.Id);
                                    {
                                        foreach (Item I in R.FindItems(new ItemView(R.TotalCount)))
                                        {
                                            //THIS IS WHERE I WANT TO GET ITEM'S CUSTOM FIELDS FROM CUSTOM FORM
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
        catch (Exception E)
        {
            MessageBox.Show(E.Message);
        }
    }
}
Community
  • 1
  • 1
Q8GEEK
  • 28
  • 2
  • You need to look at one item in a Public Folder that has you custom properties using a Mapi editor like MFCMapi or Outlook spy and then look at the property definition of one of your custom properties this will tell you exactly how to define the Extended property to use you might want to post the screen shot. – Glen Scales Dec 05 '16 at 01:20
  • I did, I couldn't find any useful information. I mean, I did, but they're all Outlook-related, I think. Now I'm looking on how to read them from Outlook, not Exchange. Thanks though, that tool really helped me get a better idea! – Q8GEEK Dec 13 '16 at 10:08
  • If you want to access those properties in EWS you need to know the property definition which you can only really obtain with a Mapi editor. So what you saying isn't useful is the actual answer if you want to access them in EWS. – Glen Scales Dec 13 '16 at 22:15

0 Answers0