Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Dec 2002
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    4605 err, without REF fields, in protected user fo (Word 2000)

    <img src=/S/joy.gif border=0 alt=joy width=23 height=23> Created a new user form template. Protected it.
    When I create a new doc based on this template, as soon as it opens, VB gives a run-time error '4605',
    'This method or property is not available because the document is a protected document.'

    When click Debug button, the Subroutine AutoNew has it's first line highlighted (Selection.WholeStory). The entire routine is as follows:

    Sub AutoNew()
    '
    ' Automatically display Ask Fields
    '
    Selection.WholeStory
    Selection.Fields.Update
    Selection.HomeKey Unit:=wdStory
    End Sub

    If I unprotect the document, the error disappears, but then the user could alter the document itself, etc.

    --
    Post 146476, ASK w/REF and Text Form Fields (Word 2000), is similar, except that I dont think there are any REF fields on my form. Mine only contains
    text, drop down lists, check boxes
    and none are repeating fields.
    Have fill-in-enabled, added Help text.
    Have no 'Run Macros on entry or exit'.

    Nothing fancy, did no VBA coding, merely created a new template using the Forms toolbar. Copied example and followed directions in Word 2000 MOUS Study Guide by Courter, Marquis & Browning, pg 154-164.

    However, viewing VBE for the doc itself (not the template), does have 1 Ref: to the template itself.
    But wouldnt this always be true of a user form based on a template?

    The simple form template is attached here (merely renamed from .dot to .doc to enable uploading.)

    (I do have WOPR tools installed.)

    I appreciate your help. Thank you very much.

    SusanH
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: 4605 err, without REF fields, in protected user fo (Word 2000)

    Instead of selecting the whole document and updating the selection try using the syntax.
    ActiveDocument.Fields.Update
    I don't think this one needs the document to be unprotected.

    If you want the Macro to do something that needs the document to be unprotected then you can use

    ActiveDocument.Unprotect Password:="Test"
    <font color=448800>' Put your code here </font color=448800>
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, Noreset:=True, Password:="Test"

    StuartR

  3. #3
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: 4605 err, without REF fields, in protected user fo (Word 2000)

    > Copied example and followed directions in Word 2000 MOUS Study Guide by Courter,
    > Marquis & Browning, pg 154-164.

    This raises all sorts of interesting issues about MOUS and study guides, but that'll have to wait for another day. <img src=/S/grin.gif border=0 alt=grin width=15 height=15>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •