Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Atlanta, GA
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Drop-Down disappears (Office 2000)

    I created a form with several protected fields. I protect the document with a "Tools, Protect Document, Forms". I protect each field with a "Control F11". When I reprotect the document, all of the protected form fields retain the data entered except the drop-down field. "Control F11" does not seem to work.

    How can I protect the data in these fields?

    Thanks.

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-Down disappears (Office 2000)

    As you've found out, you can lock a text form field to prevent losing text when you protect a form. You can't use the same method to prevent dropdown fields & checkbox fields from reverting to their defaults. You need a macro that uses:
    .NoReset = 1

    The best solution is to replace all your ToolsProtectDocument..., ProtectForm, Word commands with macros. See http://www.mvps.org/word/FAQs/MacrosVBA/Tu...FlfResetOff.htm for a macro solution.
    Cheers,

  3. #3
    3 Star Lounger
    Join Date
    Apr 2002
    Location
    Atlanta, GA
    Posts
    220
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-Down disappears (Office 2000)

    As you know, I spent many hours trying to get all of my word macros to work. They all involved protecting and unprotecting the form with passwords. Each time I entered a new macro, the pastword portion failed. With your help, I finally got everything working. I fear tampering with these again. Here are my two macros as they exist (and work) today. Can you enter the proper code for me???

    Many thanks.


    Spell Check with Password is as follows:

    Sub AutoNew()
    Dim Mybar As CommandBar
    Dim myControl As CommandBarButton
    Dim cmd As CommandBar
    Dim cmdyes As Integer
    cmdyes = 0

    For Each cmd In CommandBars
    If cmd.Name = "SpellCheck" Then
    cmdyes = 1
    Exit For
    Else
    End If
    Next

    If cmdyes = 1 Then
    CommandBars("SpellCheck").Visible = True
    Else
    Set Mybar = CommandBars _
    .Add(Name:="SpellCheck", Position:=msoBarFloating, _
    Temporary:=False)
    Set myControl = CommandBars("SpellCheck").Controls _
    .Add(Type:=msoControlButton, Before:=1)
    With myControl
    .OnAction = "SpellCheckForm"
    .FaceId = 0
    .Caption = "Spell Check the Form"
    .TooltipText = "SpellCheck the Form"
    .DescriptionText = "SpellCheckForm"
    .Style = msoButtonCaption
    End With

    End If

    CommandBars("SpellCheck").Visible = True

    End Sub


    Sub SpellCheckForm()

    ActiveDocument.Unprotect Password:="Test"
    Selection.HomeKey Unit:=wdStory
    Selection.WholeStory
    With Selection
    .LanguageID = wdEnglishUS
    ActiveDocument.CheckSpelling
    End With

    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="Test"
    End Sub


    Link Spreadsheet with password is as follows:

    Sub CreateLink()
    ActiveDocument.Unprotect Password:="Test"
    Selection.GoTo What:=wdGoToBookmark, Name:="Text1"
    Selection.PasteSpecial Link:=True, DataType:=wdPasteOLEObject, _
    Placement:=wdInLine, DisplayAsIcon:=False
    Selection.MoveLeft Unit:=wdCharacter, Count:=1, Extend:=wdExtend
    With Selection.InlineShapes(1)
    .Height = InchesToPoints(3.18)
    .Width = InchesToPoints(6.18)
    End With
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True, Password:="Test"
    End Sub

  4. #4
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Los Angeles Area, California, USA
    Posts
    7,453
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Drop-Down disappears (Office 2000)

    You don't have to change your macros. See the link that I put in the previous post. That will cure the problem by intercepting the Word commands that protect a form. A macro is the only way to prevent the fields from resetting.
    Cheers,

Posting Permissions

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