We have created a document thatputs in demographics automatically. In order
to make this work, the document cannot be protected. After the demographics
are fed in, I need to protect the document to make the rest of the form
usable to our staff. I would like to enter VBA code into an autoopen macro
that already feeds the demographics into the doc. My boss does not want staff
to be able to touch anything but the fields. Thanks for any assistance.
Patti

Re: What is the VBA for protecting a document by Word

Word
Thu Jun 23 22:16:29 CDT 2005

G'day "Patti" <Patti@discussions.microsoft.com>,

I would be happy to provide this service commercially if you need a
solution.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Patti reckoned:

>We have created a document thatputs in demographics automatically. In order
>to make this work, the document cannot be protected. After the demographics
>are fed in, I need to protect the document to make the rest of the form
>usable to our staff. I would like to enter VBA code into an autoopen macro
>that already feeds the demographics into the doc. My boss does not want staff
>to be able to touch anything but the fields. Thanks for any assistance.
>Patti


Re: What is the VBA for protecting a document by Ben

Ben
Fri Jun 24 03:42:15 CDT 2005

I thought this was a forum to help people, not to peddle your business. You
should be ashamed Steve Hudson.


"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:dnumb1h6qvofbc6csf17smjtl4bjulorev@4ax.com...
> G'day "Patti" <Patti@discussions.microsoft.com>,
>
> I would be happy to provide this service commercially if you need a
> solution.
>
> Steve Hudson - Word Heretic
>
> steve from wordheretic.com (Email replies require payment)
> Without prejudice
>
>
> Patti reckoned:
>
> >We have created a document thatputs in demographics automatically. In
order
> >to make this work, the document cannot be protected. After the
demographics
> >are fed in, I need to protect the document to make the rest of the form
> >usable to our staff. I would like to enter VBA code into an autoopen
macro
> >that already feeds the demographics into the doc. My boss does not want
staff
> >to be able to touch anything but the fields. Thanks for any assistance.
> >Patti
>



Re: What is the VBA for protecting a document by Ben

Ben
Fri Jun 24 03:46:53 CDT 2005

Patti,

Here is some code that I had used to protect/unprotect a document. You can
also use a password as I have done. I have also checked if the document is
protected before I unprotect it etc.

Hope this free help is of use.


' // --------------------------------- //
' // UnprotectDocument //
' // --------------------------------- //

Sub UnprotectDocument()
On Error Resume Next
If ActiveDocument.ProtectionType = wdNoProtection Then
Debug.Print
Else
ActiveDocument.Unprotect Password:="password"
End If
End Sub

' // --------------------------------- //
' // ProtectDocument //
' // --------------------------------- //

Sub ProtectDocument()
On Error Resume Next
If ActiveDocument.ProtectionType = wdNoProtection Then
ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
Password:="password"
Else
Debug.Print
End If
End Sub

The just call the sub you want.

Call ProtectDocument 'example how to call



"Patti" <Patti@discussions.microsoft.com> wrote in message
news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
> We have created a document thatputs in demographics automatically. In
order
> to make this work, the document cannot be protected. After the
demographics
> are fed in, I need to protect the document to make the rest of the form
> usable to our staff. I would like to enter VBA code into an autoopen macro
> that already feeds the demographics into the doc. My boss does not want
staff
> to be able to touch anything but the fields. Thanks for any assistance.
> Patti



Re: What is the VBA for protecting a document by Patti

Patti
Fri Jun 24 09:26:04 CDT 2005

Thank you Ben. It works perfectly. I appreciate your assistance and that you
did not charge me!
Patti

"Ben M" wrote:

> Patti,
>
> Here is some code that I had used to protect/unprotect a document. You can
> also use a password as I have done. I have also checked if the document is
> protected before I unprotect it etc.
>
> Hope this free help is of use.
>
>
> ' // --------------------------------- //
> ' // UnprotectDocument //
> ' // --------------------------------- //
>
> Sub UnprotectDocument()
> On Error Resume Next
> If ActiveDocument.ProtectionType = wdNoProtection Then
> Debug.Print
> Else
> ActiveDocument.Unprotect Password:="password"
> End If
> End Sub
>
> ' // --------------------------------- //
> ' // ProtectDocument //
> ' // --------------------------------- //
>
> Sub ProtectDocument()
> On Error Resume Next
> If ActiveDocument.ProtectionType = wdNoProtection Then
> ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
> Password:="password"
> Else
> Debug.Print
> End If
> End Sub
>
> The just call the sub you want.
>
> Call ProtectDocument 'example how to call
>
>
>
> "Patti" <Patti@discussions.microsoft.com> wrote in message
> news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
> > We have created a document thatputs in demographics automatically. In
> order
> > to make this work, the document cannot be protected. After the
> demographics
> > are fed in, I need to protect the document to make the rest of the form
> > usable to our staff. I would like to enter VBA code into an autoopen macro
> > that already feeds the demographics into the doc. My boss does not want
> staff
> > to be able to touch anything but the fields. Thanks for any assistance.
> > Patti
>
>
>

Re: What is the VBA for protecting a document by Doug

Doug
Fri Jun 24 15:18:49 CDT 2005

While your subject of your post just talked about protecting the document,
the body of it talked about a macro to import the demographics. It was
almost certainly that part to which Steve was referring.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Patti" <Patti@discussions.microsoft.com> wrote in message
news:4D97C58A-9CB7-489C-A164-FC1805D78B81@microsoft.com...
> Thank you Ben. It works perfectly. I appreciate your assistance and that
> you
> did not charge me!
> Patti
>
> "Ben M" wrote:
>
>> Patti,
>>
>> Here is some code that I had used to protect/unprotect a document. You
>> can
>> also use a password as I have done. I have also checked if the document
>> is
>> protected before I unprotect it etc.
>>
>> Hope this free help is of use.
>>
>>
>> ' // --------------------------------- //
>> ' // UnprotectDocument //
>> ' // --------------------------------- //
>>
>> Sub UnprotectDocument()
>> On Error Resume Next
>> If ActiveDocument.ProtectionType = wdNoProtection Then
>> Debug.Print
>> Else
>> ActiveDocument.Unprotect Password:="password"
>> End If
>> End Sub
>>
>> ' // --------------------------------- //
>> ' // ProtectDocument //
>> ' // --------------------------------- //
>>
>> Sub ProtectDocument()
>> On Error Resume Next
>> If ActiveDocument.ProtectionType = wdNoProtection Then
>> ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
>> Password:="password"
>> Else
>> Debug.Print
>> End If
>> End Sub
>>
>> The just call the sub you want.
>>
>> Call ProtectDocument 'example how to call
>>
>>
>>
>> "Patti" <Patti@discussions.microsoft.com> wrote in message
>> news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
>> > We have created a document thatputs in demographics automatically. In
>> order
>> > to make this work, the document cannot be protected. After the
>> demographics
>> > are fed in, I need to protect the document to make the rest of the form
>> > usable to our staff. I would like to enter VBA code into an autoopen
>> > macro
>> > that already feeds the demographics into the doc. My boss does not want
>> staff
>> > to be able to touch anything but the fields. Thanks for any assistance.
>> > Patti
>>
>>
>>



Re: What is the VBA for protecting a document by Word

Word
Sat Jun 25 00:25:23 CDT 2005

G'day "Ben M" <aa@ozemail.com.au>,

Ok, so you've done 10% of the job - now finish it.

Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Ben M reckoned:

>Patti,
>
>Here is some code that I had used to protect/unprotect a document. You can
>also use a password as I have done. I have also checked if the document is
>protected before I unprotect it etc.
>
>Hope this free help is of use.
>
>
>' // --------------------------------- //
>' // UnprotectDocument //
>' // --------------------------------- //
>
>Sub UnprotectDocument()
> On Error Resume Next
> If ActiveDocument.ProtectionType = wdNoProtection Then
> Debug.Print
> Else
> ActiveDocument.Unprotect Password:="password"
> End If
>End Sub
>
>' // --------------------------------- //
>' // ProtectDocument //
>' // --------------------------------- //
>
>Sub ProtectDocument()
> On Error Resume Next
> If ActiveDocument.ProtectionType = wdNoProtection Then
> ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
>Password:="password"
> Else
> Debug.Print
> End If
>End Sub
>
>The just call the sub you want.
>
>Call ProtectDocument 'example how to call
>
>
>
>"Patti" <Patti@discussions.microsoft.com> wrote in message
>news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
>> We have created a document thatputs in demographics automatically. In
>order
>> to make this work, the document cannot be protected. After the
>demographics
>> are fed in, I need to protect the document to make the rest of the form
>> usable to our staff. I would like to enter VBA code into an autoopen macro
>> that already feeds the demographics into the doc. My boss does not want
>staff
>> to be able to touch anything but the fields. Thanks for any assistance.
>> Patti
>


Re: What is the VBA for protecting a document by Patti

Patti
Mon Jun 27 08:26:01 CDT 2005

Ben, it works perfectly. I have the other 90%, I think

"Word Heretic" wrote:

> G'day "Ben M" <aa@ozemail.com.au>,
>
> Ok, so you've done 10% of the job - now finish it.
>
> Steve Hudson - Word Heretic
>
> steve from wordheretic.com (Email replies require payment)
> Without prejudice
>
>
> Ben M reckoned:
>
> >Patti,
> >
> >Here is some code that I had used to protect/unprotect a document. You can
> >also use a password as I have done. I have also checked if the document is
> >protected before I unprotect it etc.
> >
> >Hope this free help is of use.
> >
> >
> >' // --------------------------------- //
> >' // UnprotectDocument //
> >' // --------------------------------- //
> >
> >Sub UnprotectDocument()
> > On Error Resume Next
> > If ActiveDocument.ProtectionType = wdNoProtection Then
> > Debug.Print
> > Else
> > ActiveDocument.Unprotect Password:="password"
> > End If
> >End Sub
> >
> >' // --------------------------------- //
> >' // ProtectDocument //
> >' // --------------------------------- //
> >
> >Sub ProtectDocument()
> > On Error Resume Next
> > If ActiveDocument.ProtectionType = wdNoProtection Then
> > ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
> >Password:="password"
> > Else
> > Debug.Print
> > End If
> >End Sub
> >
> >The just call the sub you want.
> >
> >Call ProtectDocument 'example how to call
> >
> >
> >
> >"Patti" <Patti@discussions.microsoft.com> wrote in message
> >news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
> >> We have created a document thatputs in demographics automatically. In
> >order
> >> to make this work, the document cannot be protected. After the
> >demographics
> >> are fed in, I need to protect the document to make the rest of the form
> >> usable to our staff. I would like to enter VBA code into an autoopen macro
> >> that already feeds the demographics into the doc. My boss does not want
> >staff
> >> to be able to touch anything but the fields. Thanks for any assistance.
> >> Patti
> >
>
>

Re: What is the VBA for protecting a document by Word

Word
Mon Jun 27 10:04:03 CDT 2005

G'day "Patti" <Patti@discussions.microsoft.com>,

So why did you ask for it?


Steve Hudson - Word Heretic

steve from wordheretic.com (Email replies require payment)
Without prejudice


Patti reckoned:

>Ben, it works perfectly. I have the other 90%, I think
>
>"Word Heretic" wrote:
>
>> G'day "Ben M" <aa@ozemail.com.au>,
>>
>> Ok, so you've done 10% of the job - now finish it.
>>
>> Steve Hudson - Word Heretic
>>
>> steve from wordheretic.com (Email replies require payment)
>> Without prejudice
>>
>>
>> Ben M reckoned:
>>
>> >Patti,
>> >
>> >Here is some code that I had used to protect/unprotect a document. You can
>> >also use a password as I have done. I have also checked if the document is
>> >protected before I unprotect it etc.
>> >
>> >Hope this free help is of use.
>> >
>> >
>> >' // --------------------------------- //
>> >' // UnprotectDocument //
>> >' // --------------------------------- //
>> >
>> >Sub UnprotectDocument()
>> > On Error Resume Next
>> > If ActiveDocument.ProtectionType = wdNoProtection Then
>> > Debug.Print
>> > Else
>> > ActiveDocument.Unprotect Password:="password"
>> > End If
>> >End Sub
>> >
>> >' // --------------------------------- //
>> >' // ProtectDocument //
>> >' // --------------------------------- //
>> >
>> >Sub ProtectDocument()
>> > On Error Resume Next
>> > If ActiveDocument.ProtectionType = wdNoProtection Then
>> > ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
>> >Password:="password"
>> > Else
>> > Debug.Print
>> > End If
>> >End Sub
>> >
>> >The just call the sub you want.
>> >
>> >Call ProtectDocument 'example how to call
>> >
>> >
>> >
>> >"Patti" <Patti@discussions.microsoft.com> wrote in message
>> >news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
>> >> We have created a document thatputs in demographics automatically. In
>> >order
>> >> to make this work, the document cannot be protected. After the
>> >demographics
>> >> are fed in, I need to protect the document to make the rest of the form
>> >> usable to our staff. I would like to enter VBA code into an autoopen macro
>> >> that already feeds the demographics into the doc. My boss does not want
>> >staff
>> >> to be able to touch anything but the fields. Thanks for any assistance.
>> >> Patti
>> >
>>
>>


Re: What is the VBA for protecting a document by Ben

Ben
Thu Jun 30 05:41:42 CDT 2005

Patti, I am glad this works for you.

Word Heretic... For someone that charges money to do VBA, you sure have
problems reading plain English.

Perhaps you should re-read the question (and maybe read it again). You
might then realise that the demographic import has already been done,
leaving the original question on how to protect/unprotect the document.

It's common for people requesting *help* to set the scene in what they are
trying to achieve. This is simply what Patti did.

What part of "We _have created_ a document that puts in demographics
automatically" did you not understand??

Kind Regards, Ben


"Word Heretic" <myfullname@tpg.com.au> wrote in message
news:pa50c1dh9u9cionmioi72kfie47s8cmtk2@4ax.com...
> G'day "Patti" <Patti@discussions.microsoft.com>,
>
> So why did you ask for it?
>
>
> Steve Hudson - Word Heretic
>
> steve from wordheretic.com (Email replies require payment)
> Without prejudice
>
>
> Patti reckoned:
>
> >Ben, it works perfectly. I have the other 90%, I think
> >
> >"Word Heretic" wrote:
> >
> >> G'day "Ben M" <aa@ozemail.com.au>,
> >>
> >> Ok, so you've done 10% of the job - now finish it.
> >>
> >> Steve Hudson - Word Heretic
> >>
> >> steve from wordheretic.com (Email replies require payment)
> >> Without prejudice
> >>
> >>
> >> Ben M reckoned:
> >>
> >> >Patti,
> >> >
> >> >Here is some code that I had used to protect/unprotect a document.
You can
> >> >also use a password as I have done. I have also checked if the
document is
> >> >protected before I unprotect it etc.
> >> >
> >> >Hope this free help is of use.
> >> >
> >> >
> >> >' // --------------------------------- //
> >> >' // UnprotectDocument //
> >> >' // --------------------------------- //
> >> >
> >> >Sub UnprotectDocument()
> >> > On Error Resume Next
> >> > If ActiveDocument.ProtectionType = wdNoProtection Then
> >> > Debug.Print
> >> > Else
> >> > ActiveDocument.Unprotect Password:="password"
> >> > End If
> >> >End Sub
> >> >
> >> >' // --------------------------------- //
> >> >' // ProtectDocument //
> >> >' // --------------------------------- //
> >> >
> >> >Sub ProtectDocument()
> >> > On Error Resume Next
> >> > If ActiveDocument.ProtectionType = wdNoProtection Then
> >> > ActiveDocument.Protect Type:=wdAllowOnlyFormFields, NoReset:=True,
> >> >Password:="password"
> >> > Else
> >> > Debug.Print
> >> > End If
> >> >End Sub
> >> >
> >> >The just call the sub you want.
> >> >
> >> >Call ProtectDocument 'example how to call
> >> >
> >> >
> >> >
> >> >"Patti" <Patti@discussions.microsoft.com> wrote in message
> >> >news:A256D38F-F5B0-4919-B7E8-A817569F9286@microsoft.com...
> >> >> We have created a document thatputs in demographics automatically.
In
> >> >order
> >> >> to make this work, the document cannot be protected. After the
> >> >demographics
> >> >> are fed in, I need to protect the document to make the rest of the
form
> >> >> usable to our staff. I would like to enter VBA code into an autoopen
macro
> >> >> that already feeds the demographics into the doc. My boss does not
want
> >> >staff
> >> >> to be able to touch anything but the fields. Thanks for any
assistance.
> >> >> Patti
> >> >
> >>
> >>
>