Here is the code. It will take me to the bookmark on Page 2 but if the user
needs to go back to page 1 and make some changes to the form fields, then the
document is left unlocked. I could always put a macro button on the toolbar
that locks and unlocks the document but I am trying to make this as autmated
as possible to where no matter what, Page 1, with a section brake at the
bottom, is always protected and that if the user clicks in the table on page
2 (or anywhere other than page 1) for the narrative, the document he/she is
allowed to start typing.
Sub macGoToBMPropNarr()
' Checks to see if document is unprotected already
If ActiveDocument.Sections(1).ProtectedForForms = True Then
ActiveDocument.Sections(1).ProtectedForForms = False
ActiveDocument.Unprotect
End If
If ActiveDocument.Bookmarks.Exists("swPropNarr") Then
ActiveDocument.Bookmarks("swPropNarr").Select
End If
End Sub
Brendan was telling us:
Brendan nous racontait que :
> Here is the code. It will take me to the bookmark on Page 2 but if
> the user needs to go back to page 1 and make some changes to the form
[quoted text clipped - 20 lines]
>
> End Sub
As I wrote in my other reply in this thread, if you set up your template
properly, all you need is
ActiveDocument.Unprotect
Now, in your code, you are unprotecting the document.
May I ask why?
Also, you are not re-protecting it, so of course, section 1 is now
unprotected.
I have the feeling that all you want to do is send the user to the beginning
of the editable part of the document when they are done typing in the
formfields. If this is the case, then you do not need a macro.
Just protect section 1 (and not section 2) and then the cursor will
automatically go to the beginning of section 2 when they tab out of the last
field in section 1.
Now, if you really need a macro, try this:
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
It seems that without the macro to call another macro, Word will not
properly get to the bookmark.

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Brendan - 17 Aug 2006 17:03 GMT
That worked perfectly. Thank you very much. I can now leave the document
protected with Section(2) unprotected. I don't know why Word did not like
simply executing the "ReallymacGoToBMPropNarr()" on its own.
Brendan
> Sub macGoToBMPropNarr()
> Application.OnTime When:=Now, Name:="ReallymacGoToBMPropNarr"
[quoted text clipped - 8 lines]
> It seems that without the macro to call another macro, Word will not
> properly get to the bookmark.