NetOffice icon indicating copy to clipboard operation
NetOffice copied to clipboard

AddressEntry.Members.Add fails

Open bob-zscharnagk opened this issue 1 year ago • 0 comments

The following code fails on the ae.Members.Add statement with

Failed to proceed Method on Outlook.AddressEntries=>Add. Exception has been thrown by the target of an invocation. An attempt was made to open an unsupported property.

            NetOffice.OutlookApi.Application oApp = new NetOffice.OutlookApi.Application();
            foreach (AddressList al in oApp.GetNamespace("MAPI").AddressLists)
            {
                foreach (AddressEntry ae in al.AddressEntries)
                {
                    if (ae.Name == "MPTC members" && ae.Type == "MAPIPDL")
                    {
                        ae.Members.Add("SMTP", "Bob", "[email protected]");
                    }
                }
            }

Any ideas?

bob-zscharnagk avatar Sep 28 '23 09:09 bob-zscharnagk