Re: Moving to next field with F11 in protected document



On Apr 12, 11:36 am, "Jean-Guy Marcil" <DontEvenTry@NoSpam> wrote:
David was telling us:
David nous racontait que :





I have a VBA macro that selects the word to the left of the cursor and
inserts a file of that name into the document. The macro counts the
fields in the document before and after the file is inserted, and if
the number increases (meaning there are fields in the file that was
inserted), it goes to the first field and ends. The user types what he
wants there and advances to the next field using F11. Now we want to
use this macro in a document where part of the document is protected,
and we find not only that the macro will not advance the cursor to the
first field but also that F11 will not move it to the next field, even
though it is in the unprotected part of the document.

I could turn off the protection at the start of the macro, but I don't
have a way to turn it back on, since the macro ends before the user
types into the various fields. Is there any way around this? As a last
resort, I would even settle for turning the protection back on after
some delay to allow the user time to enter the text in the various
fields.

Thanks in advance for any help.

What types of fields do you fnd in the protected parts?

--

Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREM...@xxxxxxxxxxxxxxxxxxxxxxx
Word MVP site:http://www.word.mvps.org- Hide quoted text -

- Show quoted text -

In the protected part, I don't see any fields, but there are a lot of
bookmarks. The users don't have to enter anything there, as it has
already been completed before we get the document. In the unprotected
part, there are about 6,000 files that a user can insert using the
macro. In the ones I looked at that have fields, they are all quote
fields.

This is the line that no longer advances the cursor to the first
field, if that is any help. But I would be satisfied if just F11 would
advance to the next field.

If bk2 > bk1 Then ActiveDocument.Bookmarks("\prevsel1").Select:
Selection.NextField.Select: Selection.MoveRight unit:=wdCharacter,
Count:=1: Exit Sub

Thanks again for any assistance.

David

.



Relevant Pages

  • Re: Drop-down list created in 2007 AND older versions of Word
    ... form field into the middle of a document. ... uncertain of the background you have in forms and macro programming. ... While the protection works to enable the drop-down ... I know that drop-down lists could be created in older Word ...
    (microsoft.public.word.docmanagement)
  • RE: How to copy rows into an Excel *template* with vba
    ... There's a macro in Template.xlt with EnableOutlining already working ... & it will allow a user to group & ungroup columns in the template sheet ... The above macro doesn't work in the new workbooks created with Macro 9 even ... I tried the protection code but am receiving this error "Compile Error. ...
    (microsoft.public.excel.programming)
  • Re: Cell Protection Query
    ... I still don't see how this macro can work on your protected sheet. ... cells, unlock all the cells in the mergearea, merge those cells, and reportect ... BUT the protection issue has disappeared. ...
    (microsoft.public.excel.misc)
  • Re: I need Macro Help
    ... It sounds like the macro you posted is working fine for unprotected (whatever ... > out by inexperienced users and there is no way that I can unprotect them. ... > Dim varr As Variant ... > protection is turned off. ...
    (microsoft.public.excel)
  • Re: Visual Basic Error Run Time Error, Type Mismatch
    ... I forgot I have another macro that I created ... ... Private Sub Worksheet_Change(ByVal Target As Range) ... For Each wSheet In Worksheets ... through them turning on the protection that is already on. ...
    (microsoft.public.excel.misc)

Loading