Results 1 to 9 of 9
  1. #1
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    DOT created DOCs (Word 2000)

    Heh,
    I have several word documents that were created from a DOT document. Since creating this DOT there have been several occasions where I've needed to change the macros in the DOT. Is there any way to apply these changes to the older documents? These documents have form fields in a table and the entire document is locked. If I unlock it to make changes to it's macros all the data will be deleted when the document is locked again. Is there any work around to my problem?

  2. #2
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: DOT created DOCs (Word 2000)

    The normal behaviour is that the macros don't actually reside in the doc files. This means that if you change the template macros then any doc with that template attached will see the new macros.

    The second problem of the emptying of form fields has been solved in the later versions of Word but the following macro or something along the same lines will protect your field contents in Word 2000 and 97.
    <pre>Public Sub ProtectForm()
    ' Macro created 8/03/99 by Andrew Lockton
    'This macro stops the forms protection button from wiping the data in the fields
    ' when the document is protected. User is given an input choice.
    ' Overrides the built in ProtectForm command in word

    Dim Msg, Style, Title, Response

    If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
    ActiveDocument.Unprotect
    Else
    Msg = "Do you want to empty the fields already typed?" ' Define message.
    Style = vbYesNo + vbDefaultButton2 ' Define buttons.
    Title = "Empty Fields" ' Define title.
    Response = MsgBox(Msg, Style, Title)
    If Response = vbYes Then ' User chose Yes.
    If ActiveDocument.ProtectionType = wdNoProtection Then
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
    NoReset:=False, Password:=""
    End If
    Else ' User chose No.
    If ActiveDocument.ProtectionType = wdNoProtection Then
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, _
    NoReset:=True, Password:=""
    End If
    End If
    End If
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

  3. #3
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOT created DOCs (Word 2000)

    Andrew,
    Thanks for the macro!
    Another related question..
    What about changing the form itself. If I make changes to the form how do I make those changes available to the previously created documents?

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: DOT created DOCs (Word 2000)

    Again, as Andrew wrote, when you create a document based on a template, the macros and userforms are not copied into the document. The document retains a link to the template it is based on, and it will automatically use the current version of macros and userforms in the template. So if you modify the userform in the template, all documents should use the new version.

  5. #5
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOT created DOCs (Word 2000)

    Hans I've changed the DOT. Is there a way to make those changes effective to previous created documents

  6. #6
    Super Moderator
    Join Date
    Jan 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    3,852
    Thanks
    4
    Thanked 259 Times in 239 Posts

    Re: DOT created DOCs (Word 2000)

    Your original question stated you need to change macros (covered by template changes) - but the last question reveals that you are changing form fields already within the documents created. That will require changes in every document (ie the horse has already bolted so it is too late to shut the gate)

    The way templates and docs work is that the original content of the file comes from the template but after that any changes to each document must be made directly in the document.
    Andrew Lockton, Chrysalis Design, Melbourne Australia

  7. #7
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOT created DOCs (Word 2000)

    Hans/Andrew
    I realized the macro is already in use on all my documents. My problem occurs when I unprotect these documents, make changes to the doc created from a dot and protect it again. Everything in the form fields is wiped out.

  8. #8
    2 Star Lounger
    Join Date
    Jan 2001
    Location
    Utah, USA
    Posts
    120
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: DOT created DOCs (Word 2000)

    I realize that now, thanks

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

    Re: DOT created DOCs (Word 2000)

    The Macro in <post:=444,342>post 444,342</post:> shows how you can protect a document without clearing all the form fields.

    StuartR

Posting Permissions

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