DavidRocastle was telling us:
DavidRocastle nous racontait que :
Hi i would like to have a macro for Microsoft word whereby when
clicked it will take me to the top of the next page of the whole
document. The problem is, is that the document is protected.
I just need a macro on the top of the page whereby when clicked it
will bring me on to the top of the next page. This is done to check
that the correct data is entered at the top of the page!
The code would be:
With ActiveDocument
.Unprotect
Selection.GoTo wdGoToPage, wdGoToNext, 1
.Protect wdAllowOnlyFormFields
End With
But the cursor cannot be positioned on a page of a protected document that
does not contain editable fields. If the top of the next page (or the whole
page for that matter) does not contain formfields, the macro will not work
truly as expected, it will only take you to the next available field, if
none are available, it will place the cursor at the top of the document.
Or, if there are fields in the document, but not after the current page, the
macro will take you to the first field in the document.
If the document does not have any fields, the above macro will always place
the cursor on the first page and then display the second page, as soon as
the user clicks on that second page, the first page is displayed because
this is were the cursor is.
If you have formfields on your pages, then it will work, except that the
first available field on the page will be selected, which might not be at
the top of the page.
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org