VBA: Exiting an protected form field to an unprotected bookmark
  • Summary: 2 page document with two continuous section breaks. One located at the bottom of page 1 and the other at the bottom of page 2. AutoNew macro which protects page 1 and leaves page 2 unprotect (works fine). Page 1 is a large table with form fields. Page 2 contains a bookmark where the narrative will start. The last form field on Page 1 contains an on exit macro to go to the bookmark on page 2.

    Goal #1: To get the cursor from the last form field on page 1 to the narrative bookmark on page 2.
    Goal #2: Leave Page 1 protected via the section break and page 2 unprotected just as the document opened via the AutoNew macro.

    Issues: Using numerous variations of the below code, the only thing that happens is the cursor does actually exit the last form field (via the exit macro) but only goes to the bottom of page 1 at the section break and never makes it to the bookmark. In view mode

    ActiveDocument.Unprotect
    ActiveDocument.Sections(1).ProtectedForForms = False
    If ActiveDocument.Bookmarks.Exists("swPropNarr") Then
    ActiveDocument.Bookmarks("swPropNarr").Select
    End If

    FYI: If I run the macro while the document is unprotected, it works perfect.


  • The macro must be called from within another macro. Don't ask me why but that is the only way it will work:

    Sub macGoToBMPropNarr()
    Application.OnTime When:=Now, Name:="ReallymacGoToBMPropNarr"
    End Sub
    -----------------------------------------------------------
    Sub ReallymacGoToBMPropNarr()
    If ActiveDocument.Bookmarks.Exists("swPropNarr") Then
    ActiveDocument.Bookmarks("swPropNarr").Select
    End If
    End Sub

    Thanks to: microsoft.public.word.vba.general







  • #If you have any other info about this subject , Please add it free.#
    Your name:
    E-mail:
    Telphone:

    Your comments:


    If you have any other info about VBA: Exiting an protected form field to an unprotected bookmark , Please add it free.
    | More »