Page 1 of 2 12 LastLast
Results 1 to 15 of 23
  1. #1
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    using forms (Word 2000)

    Hello everybody!

    I have a question, which is possibly easy to answer (but maybe I am too naive). I would like to create a form (that's the easy part...). But now comes the point. When I use this form, I would like to still be able to insert tables, graphics and so on (all you can do in a usual word-document). For me it seems that it is not possible to realize this. Since I am usually a user of Excel, I have the idea that it must be possible to protect only some parts of a document, and leave other parts unprotected.
    The idea behind it: I want to create a template for reports. There I want to have some Checkboxes on the first page, through which I may choose, what kind of report the reader may expect. This can be done easily by creating a form. Unfortunately it is essential to have every freedom Word gives the author to write the report.
    Does somebody have a suggestion for this? Any help will be appreciated!!

    Many greetings, Porley

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

    Re: using forms (Word 2000)

    In a form document, you can have protected and unprotected sections. To create a new section, position the insertion point where the new section should begin, and select Insert | Break... For a form document, a Continuous section break is most appropriate.
    To protect only some sections, select Tools | Protect document..., click the Forms option button and then click Sections... The "Section Protection" lets you specify which sections should be protected.
    You will only be able to insert tables, pictures etc. in unprotected sections.
    Attached Images Attached Images
    • File Type: png x.PNG (10.9 KB, 1 views)

  3. #3
    Platinum Lounger
    Join Date
    Nov 2001
    Location
    Melbourne, Victoria, Australia
    Posts
    5,016
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    I don't know if this is relevant to your intention, but "rich" content, such as tables and graphics, can be stored as Autotext entries within a template. This means that it's possible, for example, to have a specific "standard" graphic appear in a particular place, depending on the user's form preferences.

    Alan

  4. #4
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    Hello Hans!

    Thank you very much for this answer!! Now my problem is partly fixed. Just to make things a little bit more complicated: one of the newly defined sections consists of a table with two columns. The left one should be unprotected, the right one should be protected.
    Do you have a solution for this as well?
    Does somebody else have an idea for this?

    Thank you for reading this post and thinking about this problem.

    Best regards,

    Porley

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

    Re: using forms (Word 2000)

    You can't have the first column of a table in an unprotected section and the second column in a protected section.

    One workaround is to put the entire table in a protected section, and to put a text field from the Forms toolbar in each cell of the first column. The user will only be able to enter plain text, not formatted text, graphics etc.

    Another workaround is to set that part of the document to two columns (Format | Columns...), and to put a one column table in each document column. Put the second document column in its own protected section.

  6. #6
    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: using forms (Word 2000)

    The third workaround is to switch to Word 2003. The protection model, at least the one I saw demo'd, is completely different and much more flexible. Of course, if you can't afford to buy all your users 2003, that isn't going to work. <img src=/S/sad.gif border=0 alt=sad width=15 height=15>

  7. #7
    2 Star Lounger
    Join Date
    Mar 2002
    Location
    Germany, Germany
    Posts
    169
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    Unfortunately it is not. The idea behind my question is as follows: In my company we often have to write reports. Due to some corporate identiity ideas, all these reports should formally look the same. On the first page there should be some checkboxes, with which you may mark, what kind of report it is (there are severel kinds). You should be able to mark this by checking one and unchecking all the others. What I found out is, that you can only realize this in a form when it is protected. But in a protected form you cannot use all the other features from word like inserting graphics, foot notes or stuff like that. Now I tried to seperate the form into protected and unprotected areas. Unfortunately, I have one area, where you can find a table with two columns. In one column you would find the mentioned checkboxes, the other one should be unprotected. This seems not to be possible (unless you do not use Word XP, which is out of discussion). But even if I could get rid of this problem, there seems to be another one. Even in an unprotected part of a form you cannot work properly (e.g. generate footnotes) unless you unprotect the form (which does not make sense, because then I wouldn't need a form at all!) So for me it seems, that I cannot realize, what I want to...
    Maybe one of you has an idea, but I don't know how to continue. By the way: the layout of the template is given, and I am not to change it in any way. I only may find a suitable way to work with it...

    Any idea will be appreciated!

    Best regards,

    Porley

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

    Re: using forms (Word 2000)

    You could write macros that unprotect the document, change something that can only be done in an unprotected document, then reprotect it. Assign these macros to custom toolbar buttons, custom menu items and/or custom keyboard shortcuts. Skeleton code:

    ' unprotect
    ActiveDocument.Unprotect
    ' code to be executed in unprotected doc
    ...
    ' reprotect without clearing form fields
    ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True

  9. #9
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    I think you discovered the single most frustrating thing for Word developers IMHO. It should be a consolation that there are millions of other developers all over the world that suffer with you... NOT! <img src=/S/bwaaah.gif border=0 alt=bwaaah width=123 height=15>
    If you really need the forms functionality - as we do - then there is really no alternativ I know of than to "hijack" all the relevant internal Word functions by writing your own Sub's performing exactly the same task and storing those Sub's in a add-in placed in the Word Startup folder. But even then there are quit a few drawbacks!

    For your particular problem there may be a work-around. From what you write I understand that you know how to use the checkboxes from the Forms toolbar. You can accomplish almost the same functionality with the checkboxes from the Toolset toolbar (not quite sure about this name, had to translate it from my Dutch version...). The VBA Sub's handling these checkboxes must reside in the ThisDocument module.
    I have no personal experience with these checkboxes. But I have a few documents with a commandbutton to perform a certain task. And that works fine in a unprotected document. The only drawback in my case is that this commandbuttons (and other controls) are always printed - at least I haven't discovered yet how to prevent that.. But if that is no problem for your situation then this could be something to experiment with.

    Good luck
    JanB

  10. #10
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    Hans, and Porley of course,

    I found out something quite interesting. I'm experimenting with Office 2003 (Dutch version) a bit because we are considering upgrading from Office 97. In Word 97 VBA there is only 1 event on application level that you can use: DocumentChange. But in Word 2003 VBA there are a lot more. One of them is WindowSelectionChange and that gave me an idea.
    I created a document with 2 sections, marked section 1 as protected and section 2 as unprotected and then protected the document for forms.
    In a properly declared class module I put this code:

    Public WithEvents wdApp As Word.Application

    Private Sub WindowSelectionChange(ByVal Sel As Selection)
    If Sel.Information(wdActiveEndSectionNumber) = 1 Then
    ActiveDocument.Protect NoReset:=True, Type:=wdAllowOnlyFormFields
    Else
    ActiveDocument.Unprotect
    End If
    End Sub

    If I click, or move the cursor with the arrow keys in the unprotected Section 2, then the whole document is unprotected. And clicking, or moving the cursor with the arrow keys into Section 1 protects the whole document again, disabling the possibility to enter tekst in that section...
    I just found out, so I'm not sure of all the drawbacks and ramifications yet, but it sure has some perspective!

    I don't know of these extra events are already present in Word 2000 VBA, but I heard from a co-worker that there are more than 1 in Word XP. Because I dont have that version here, I cannot tell if this particular event is present and my code is working in Word XP.

    JanB

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

    Re: using forms (Word 2000)

    Jan,

    WindowSelectionChange was introduced in Word 2000, together with a whole slew of other new events, so your code should work there too. If Porley can use this, it would be nice to explain how to initialize the wdApp variable automatically when the document is opened.

    In your other post, you mentioned that you didn't know the exact name of a toolbar in English. It is "Control Toolbox". You can download an Excel spreadsheet with translations for several Office apps and several languages from Jan Karel Pieterse's website http://www.jkp-ads.com.

  12. #12
    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: using forms (Word 2000)

    Brilliant idea! I've had odd results with WindowSelectionChange in other contexts, and it can drag down speed on a slower CPU, but because it can be much more granular than a section (you could even detect whether a user was trying to enter the "do not edit" column of a particular table), it's a great approach to try.

    Bryan Carbonnell posted an example of the bits and pieces needed to catch a WindowSelectionChange event in <post#=196505>post 196505</post#> over on the VB/VBA board.

  13. #13
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    Hans,

    If Porley likes the idea, I'll do that. And thanks for spreadsheet URL !

    JanB

  14. #14
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    Jefferson,

    Thanks for the URL to a interesting post.

    JanB

  15. #15
    4 Star Lounger
    Join Date
    Dec 2003
    Location
    Zoetermeer, Zuid-Holland, Netherlands
    Posts
    559
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: using forms (Word 2000)

    A good article on document and application events by Bill Coan, Take Control of Microsoft Word Through Events, can be found here.

    JanB

Page 1 of 2 12 LastLast

Posting Permissions

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