The bookmark is not valid outlook 2013
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
Re: The bookmark is not valid outlook 2013
what is the value contained in type at that point?
does the error occur on the first username to be added? or just successive ones? if so try calling update after each
Re: The bookmark is not valid outlook 2013
Quote:
Originally Posted by
westconn1
what is the value contained in type at that point?
does the error occur on the first username to be added? or just successive ones? if so try calling update after each
Yes, it occurs on first attempts during this line of code:
addrEntries.Add(type, username, useraddress) ---> EXCEPTION OCCURS
The type variable is a String that contains static "EX" which I believe stands for Exchange user. I pulled all other individual emails and they all have EX as type.
As of now I am not able to add any new entry to the addrEntries collection.