The bookmark is not valid outlook 2013-VBForums
Results 1 to 3 of 3

Thread: The bookmark is not valid outlook 2013

  1. #1

    Thread Starter
    New Member
    Join Date
    Dec 2016
    Posts
    4

    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

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    22,380

    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
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    New Member
    Join Date
    Dec 2016
    Posts
    4

    Re: The bookmark is not valid outlook 2013

    Quote Originally Posted by westconn1 View Post
    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.