Click here to Skip to main content
15,909,651 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to convert XML to text file Pin
jschell21-May-24 12:27
jschell21-May-24 12:27 
AnswerRe: How to convert XML to text file Pin
OriginalGriff21-May-24 19:02
mveOriginalGriff21-May-24 19:02 
QuestionWhere to hand over the instance of my plugin dll class to another class Pin
AtaChris18-May-24 8:34
AtaChris18-May-24 8:34 
AnswerRe: Where to hand over the instance of my plugin dll class to another class Pin
OriginalGriff18-May-24 20:20
mveOriginalGriff18-May-24 20:20 
GeneralRe: Where to hand over the instance of my plugin dll class to another class Pin
Dave Kreskowiak19-May-24 5:02
mveDave Kreskowiak19-May-24 5:02 
GeneralRe: Where to hand over the instance of my plugin dll class to another class Pin
OriginalGriff19-May-24 5:21
mveOriginalGriff19-May-24 5:21 
GeneralRe: Where to hand over the instance of my plugin dll class to another class Pin
Dave Kreskowiak19-May-24 5:31
mveDave Kreskowiak19-May-24 5:31 
QuestionFind email-enabled public folders exclusively using "Microsoft.Office.Interop.Outlook" Pin
temuco14-May-24 4:25
professionaltemuco14-May-24 4:25 
Is there a way to exclusively identify email-enabled public folders using Microsoft.Office.Interop.Outlook? EWS or PowerShell should not be used. The program should run on the workstation and utilize the installed Outlook.

Once I've found an email-enabled public folder, I should list the emails contained within it.

So far, I'm encountering difficulties. For instance, I have the following method:

C#
// Recursive method for listing the email addresses of email-enabled public folders
static void ListPublicFolders(Outlook.Folder? folder, string indent)
{
    if (folder != null)
    {
        foreach (object obj in folder.Folders)
        {
            if (obj is Outlook.Folder)
            {
                Outlook.Folder? subFolder = obj as Outlook.Folder;

                if (subFolder != null && subFolder.DefaultItemType == Outlook.OlItemType.olMailItem)
                {
                    Outlook.MAPIFolder? parentFolder = subFolder.Parent as Outlook.MAPIFolder;
                    string              parentName   = parentFolder != null ? parentFolder.Name : "Parent folder not found";

                    Console.WriteLine($"{indent}- {subFolder.Name}: {parentName}");

                    if (parentFolder != null)
                    {
                        Marshal.ReleaseComObject(parentFolder);
                    }
                }

                ListPublicFolders(subFolder, indent + "  ");

                if (subFolder != null)
                {
                    Marshal.ReleaseComObject(subFolder);
                }
            }
        }
    }
}

The query

C#
if (subFolder != null && subFolder.DefaultItemType == Outlook.OlItemType.olMailItem)

fails because subFolder.DefaultItemType returns the value Outlook.OlItemType.olPostItem, even though the public folder was set up as an email-enabled folder in Exchange.

Specifically, this is in Microsoft 365. In the Exchange admin center, when creating the folder, I explicitly checked the box for "Email-enabled." This action resulted in two additional options: "Delegation" and "Email properties." In "Email properties," I can specify an alias and a display name. By default, both fields are set to "Orders." Now, I expect the public folder to be email-enabled, with the email address orders@domain.tld.

I don't understand why Outlook is treating the folder incorrectly (I can only create posts and not send emails).

Perhaps someone can help me figure this out.

Thank you and best regards,

René
QuestionI need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 4:19
professionalglennPattonWork39-May-24 4:19 
AnswerRe: I need to convert a the string of a Text box to a Value Pin
Tony Hill9-May-24 4:41
professionalTony Hill9-May-24 4:41 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
Richard Deeming9-May-24 4:43
mveRichard Deeming9-May-24 4:43 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
Tony Hill9-May-24 4:47
professionalTony Hill9-May-24 4:47 
AnswerRe: I need to convert a the string of a Text box to a Value Pin
Richard Deeming9-May-24 4:42
mveRichard Deeming9-May-24 4:42 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 5:03
professionalglennPattonWork39-May-24 5:03 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
Richard MacCutchan9-May-24 6:02
mveRichard MacCutchan9-May-24 6:02 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 6:48
professionalglennPattonWork39-May-24 6:48 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
Richard MacCutchan9-May-24 6:56
mveRichard MacCutchan9-May-24 6:56 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 7:06
professionalglennPattonWork39-May-24 7:06 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
jeron19-May-24 6:58
jeron19-May-24 6:58 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 7:10
professionalglennPattonWork39-May-24 7:10 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
jeron19-May-24 6:05
jeron19-May-24 6:05 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
glennPattonWork39-May-24 6:58
professionalglennPattonWork39-May-24 6:58 
GeneralRe: I need to convert a the string of a Text box to a Value Pin
jeron19-May-24 7:19
jeron19-May-24 7:19 
QuestionCommand Line Arguments For IrfanView using C# WinForm Pin
Member 143542147-May-24 8:50
Member 143542147-May-24 8:50 
AnswerRe: Command Line Arguments For IrfanView using C# WinForm Pin
Dave Kreskowiak7-May-24 14:55
mveDave Kreskowiak7-May-24 14:55 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.