PDA

View Full Version : [SOLVED:] Protection/ bookmark problems



gibbo1715
11-06-2005, 09:24 AM
All

I have a word document where i need to protect it a bit at a time as it goes through a process, so nothing can be entered in the first part when submitted, Part 2 leaves the first submission protected and protects the second part of the doc and so on, this I have done using continuous breaks and protect them as i need as follows


ActiveDocument.Sections(1).ProtectedForForms = True
ActiveDocument.Sections(1).ProtectedForForms = False

My problem is using this method I cannot use form controls, this is not a problem in respect of my users doing things they shouldnt

But is a problem as I want to populate parts of a userform from parts of my document.

So my question is is there a method of getting the data typed in by my users same as I would if I could use


Me.TextBox5.Value = ActiveDocument.FormFields("Text1").Result

I cant figure a way of using bookmarks that works as of yet

Or is there another method of protecting my document a bit at a time so I can use a different form of protection and form controls (Which is probably a more professional way of doing things if possible to do)

cheers

Gibbo

fumei
11-07-2005, 08:18 PM
It may help to clearly describe precisely what you are doing, and when.

You are displaying a userform? When? Why? Are you using it to fill in formfields? What is the purpose of the protection? It seems that you want to lock the users out of parts of the document. That is fine. But what is the process by which some sections are locked and other not? Do any section requires shifting back again. What is calling the userform?

Why are you using a textbox control on the userform? Is the user going to type something into it? if they are NOT going to type anything into it...use a label, not a textbox. If they ARE going to be typing something into it, then why are you putting text ( the .Result) into it?

More information please.

I have no problem getting a userform textbox to get the .Result from a formfield. I have a formfield with an OnExit macro that opens the form. The form loads, grabbing the .Result and puts it into the (in my case) label. It works for a textbox as well. But I still do not understand why you are using a textbox.

What exactly is the problem?

gibbo1715
11-08-2005, 02:38 AM
Hi Gerry

Thanks for the reply sorry if its not clear

I have used a textbox on a userform as an easy example, what I am actually doing is pulling data from word and dumping it into an access database, i ll explain the process as follows.

I have an application form that is in three parts

1. Part 1 is completed by the applicant, when complete they need to click a submit button, on doing this I need to lock the first part of the form so nothing can be added.

I am currently doing this by allowing my users to update the form without using form controls, I have no problems with my users changing the layout of the form but would prefer using form controls if I can completely lock part of a document so nothing can be edited.

2. The application gets looked at by a supervisor and they can either submit this to seniour manager for approval (In which case Part two of the application also becomes locked and uneditable) or they can refuse it and return it to the original applicant so part 1 becomes unlocked again

3. Senior Manager can authorise the document ( Which lockes the whole document so nothing can be edited, and I then need to be able to store parts of the information into a database, or as in my question onto a userform.


So my problem is extracting the information I want to populate my database or userform.

Either I need to be able to use form controls and still be able to lock part of a document so nothing can be edited at all in that part but the other parts can be updated still or

I need to be able to use my current method but be able to locate various information that has been filled in by my users and put that information into a userform or database.

Hope that explains a bit better what im after

cheers

gibbo

fumei
11-08-2005, 12:23 PM
1. Part 1 is completed by the applicant, when complete they need to click a submit button, on doing this I need to lock the first part of the form so nothing can be added.

I am currently doing this by allowing my users to update the form without using form controls, I have no problems with my users changing the layout of the form but would prefer using form controls if I can completely lock part of a document so nothing can be edited.

If you ARE using formfields, the section containing those formfields must be protected for forms. This locks editing of everything BUT formfields. However, it does NOT lock the formfields. However, if I understand correctly, what you want to be able to do is have formfields to accept data, and when OK, KEEP the data, but totally lock the section. This can be done.

You can take the data from the formfields and place into bookmarks, then delete the formfields. If you keep the protection for forms ON, then the section is locked for editing. With the removal of the formfields there is nothing the user can edit at all.

gibbo1715
11-08-2005, 02:45 PM
Thanks Gerry,

I ll have a play

Gibbo