Hello,

I am currently working on a project in VS2013. I am trying to automate/code the add/remove user email from distribution list (in GAB) process in Outlook 2013. I was able to pull the distribution list from the GAB of which I want to add/remove user emails from. But when I run through the AddressEntries.Add(type("EX"), name(LastN,FirstN), address(LDAP location of user)) method I get an error:

"An unhandled exception of type 'System.Runtime.InteropServices.COMException' occurred in ConsoleApplication1.exe

Additional information: The bookmark is not valid."

The loop where the error is below, it is essentially pulling from a local txt file that has the name and address defined for a new user:
Do While Not txtfile.EndOfStream
username = txtfile.ReadLine()
Console.WriteLine(username)
'name = username
useraddress = txtfile.ReadLine()
'address = useraddress
Console.WriteLine(useraddress)
addrEntries.Add(type, username, useraddress) ---> EXCEPTION OCCURS

Loop

I am not sure why it wouldn't work, during runtime the variable's inputs and their format match what a current valid user has.

Any suggestions or feedback is appreciated!

Thanks,
Steve