Results 1 to 4 of 4
  1. #1
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Error checking from .Add (All)

    Hi

    Just need to know how do I process errors returned from .Add functionality, e.g. adding a bookmark. It doesn't seem to return any error, i.e. it never goes to the error handler. Specifically this:

    On Error GoTo ErrorHandler
    ActiveDocument.Bookmarks.Add "_InMacro_"
    Exit Sub

    ErrorHandler:
    MsgBox Err.Description
    Err.Clear

    Thanks

    Robie
    Thanks.
    Robie

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Error checking from .Add (All)

    That code doesn't generate an error, the new bookmark is Hidden (because it starts with an _ character), but it does get created.

    To see hidden bookmarks try Insert > Bookmark and select the Hidden checkbox.

    StuartR

  3. #3
    4 Star Lounger
    Join Date
    Jan 2002
    Location
    London, Gtr London, England
    Posts
    416
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Error checking from .Add (All)

    Post deleted by robie
    Thanks.
    Robie

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Error checking from .Add (All)

    > Does it mean that if the bookmark created was NOT hidden then it would return an error?

    Not at all, you would only get an error if something prevented the bookmark from being created. Your code is perfectly valid so doesn't generate errors.

    StuartR

Posting Permissions

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