B
Brendan
This was asked in another post of mine but I am still not getting a results.
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 unprotected (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. The section then shows as being unprotected.
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.
Conclusion: It almost seems that the macro is running too fast for the
document to unprotect itself prior to going to the the 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 unprotected (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. The section then shows as being unprotected.
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.
Conclusion: It almost seems that the macro is running too fast for the
document to unprotect itself prior to going to the the bookmark.