WUGNET, the Windows User Group Network
Your Complete Resource Center for "The Best" in Shareware, Computing Tips and Support, Windows Industry News... and much more!
Home Forums Shareware Windows Tips Hot Offers FREE Newsletters Arcade Contact Us About Partners
Search WUGNET: RSS Feeds RSS Feeds Advertise with WUGNET    |    Shareware eBooks
HomeHome FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

formatting and spellcheck in locked forms

 
Goto page Previous  1, 2
   Home -> Office -> User Forms RSS
Next:  Drop downs won't retain entry macros  
Author Message
Graham Mayor

External


Since: Jul 04, 2006
Posts: 8122



(Msg. 9) Posted: Thu Feb 07, 2008 9:51 am
Post subject: Re: formatting and spellcheck in locked forms [Login to view extended thread Info.]
Archived from groups: microsoft>public>word>vba>userforms (more info?)

The code to lock/unlock forms is straightforward. Add the document password
(if any) between the quotes in both lines that contain
Password:=""

Dim oFld As FormFields
Dim bProtected As Boolean
Set oFld = ActiveDocument.FormFields

'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If

'Do your thing with the document here

'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

TPD600 wrote:
> I have gone to the website stated in this message, but for some
> reason, I can not get the Macro to work for me. Is there anyone who
> would be willing to look at my form and tell me what I am doing
> wrong. I would GREATLY appreciate it.
>
> Thank you.
>
> "Jay Freedman" wrote:
>
>> On Mon, 14 Jan 2008 16:46:40 -0600, "CEV" <chadv.RemoveThis@advancebkg.com>
>> wrote:
>>
>>> We have a few forms I created in Word. We are currently using Word
>>> 2003. There are some check boxes, combo boxes, and text boxes. We
>>> protect the document so that users can fill in the form. When
>>> protected though, the spell check is lost and we are also not able
>>> to use any formatting tools such as bold, the ability to change
>>> font and size, and use bullets. How can these options be made
>>> available for protected forms?
>>>
>>> Thank You,
>>>
>>> CEV
>>>
>>
>> For the spell check, you need the macro in
>> http://www.word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm.
>>
>> Word's form fields don't support font formatting. The closest you
>> can come to that is to insert section breaks before and after a
>> paragraph, and mark the section between the breaks as unprotected.
>> To do that, click Tools > Protect Document and, in the task pane,
>> select "Filling in forms" and then click the "Select sections" link
>> that appears below it. Uncheck the section between the breaks.
>>
>> --
>> Regards,
>> Jay Freedman
>> Microsoft Word MVP FAQ: http://word.mvps.org
>> Email cannot be acknowledged; please post all follow-ups to the
>> newsgroup so all may benefit.
Back to top
Login to vote
TPD600

External


Since: Feb 06, 2008
Posts: 2



(Msg. 10) Posted: Fri Feb 08, 2008 7:36 pm
Post subject: Re: formatting and spellcheck in locked forms [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

It's the spell check script that I can not get to work in a protected form.
I copied the macro per the webpage, saved it to my form, but I still can not
spell check

"Graham Mayor" wrote:

> The code to lock/unlock forms is straightforward. Add the document password
> (if any) between the quotes in both lines that contain
> Password:=""
>
> Dim oFld As FormFields
> Dim bProtected As Boolean
> Set oFld = ActiveDocument.FormFields
>
> 'Unprotect the file
> If ActiveDocument.ProtectionType <> wdNoProtection Then
> bProtected = True
> ActiveDocument.Unprotect Password:=""
> End If
>
> 'Do your thing with the document here
>
> 'Reprotect the document.
> If bProtected = True Then
> ActiveDocument.Protect _
> Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
> End If
>
>
> --
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
> Graham Mayor - Word MVP
>
> My web site www.gmayor.com
> Word MVP web site http://word.mvps.org
> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>
> TPD600 wrote:
> > I have gone to the website stated in this message, but for some
> > reason, I can not get the Macro to work for me. Is there anyone who
> > would be willing to look at my form and tell me what I am doing
> > wrong. I would GREATLY appreciate it.
> >
> > Thank you.
> >
> > "Jay Freedman" wrote:
> >
> >> On Mon, 14 Jan 2008 16:46:40 -0600, "CEV" <chadv RemoveThis @advancebkg.com>
> >> wrote:
> >>
> >>> We have a few forms I created in Word. We are currently using Word
> >>> 2003. There are some check boxes, combo boxes, and text boxes. We
> >>> protect the document so that users can fill in the form. When
> >>> protected though, the spell check is lost and we are also not able
> >>> to use any formatting tools such as bold, the ability to change
> >>> font and size, and use bullets. How can these options be made
> >>> available for protected forms?
> >>>
> >>> Thank You,
> >>>
> >>> CEV
> >>>
> >>
> >> For the spell check, you need the macro in
> >> http://www.word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm.
> >>
> >> Word's form fields don't support font formatting. The closest you
> >> can come to that is to insert section breaks before and after a
> >> paragraph, and mark the section between the breaks as unprotected.
> >> To do that, click Tools > Protect Document and, in the task pane,
> >> select "Filling in forms" and then click the "Select sections" link
> >> that appears below it. Uncheck the section between the breaks.
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP FAQ: http://word.mvps.org
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all may benefit.
>
>
>
Back to top
Login to vote
Graham Mayor

External


Since: Jul 04, 2006
Posts: 8122



(Msg. 11) Posted: Sat Feb 09, 2008 11:05 am
Post subject: Re: formatting and spellcheck in locked forms [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

The macro

Sub SpellCheckForm()
Dim i As Integer
Dim bProtected As Boolean

'Unprotect the file
If ActiveDocument.ProtectionType <> wdNoProtection Then
bProtected = True
ActiveDocument.Unprotect Password:=""
End If

'check each formfield for spelling
For i = 1 To ActiveDocument.FormFields.Count
ActiveDocument.FormFields(i).Select
#If VBA6 Then
Selection.NoProofing = False
#End If
Selection.LanguageID = wdEnglishUK
Selection.Range.CheckSpelling
Next

'Reprotect the document.
If bProtected = True Then
ActiveDocument.Protect _
Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
End If
End Sub

based on the web site code will spell check protected form fields (legacy
fields in Word 2007) using the English UK dictionary regardless of the
proofing option set to the form field itself. If you want American spellings
change UK to US.

You will need to run the code either from a toolbar button (I have the macro
added to the forms toolbar) or on exit from a field

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>

TPD600 wrote:
> It's the spell check script that I can not get to work in a protected
> form. I copied the macro per the webpage, saved it to my form, but I
> still can not spell check
>
> "Graham Mayor" wrote:
>
>> The code to lock/unlock forms is straightforward. Add the document
>> password (if any) between the quotes in both lines that contain
>> Password:=""
>>
>> Dim oFld As FormFields
>> Dim bProtected As Boolean
>> Set oFld = ActiveDocument.FormFields
>>
>> 'Unprotect the file
>> If ActiveDocument.ProtectionType <> wdNoProtection Then
>> bProtected = True
>> ActiveDocument.Unprotect Password:=""
>> End If
>>
>> 'Do your thing with the document here
>>
>> 'Reprotect the document.
>> If bProtected = True Then
>> ActiveDocument.Protect _
>> Type:=wdAllowOnlyFormFields, NoReset:=True, Password:=""
>> End If
>>
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>>
>> TPD600 wrote:
>>> I have gone to the website stated in this message, but for some
>>> reason, I can not get the Macro to work for me. Is there anyone who
>>> would be willing to look at my form and tell me what I am doing
>>> wrong. I would GREATLY appreciate it.
>>>
>>> Thank you.
>>>
>>> "Jay Freedman" wrote:
>>>
>>>> On Mon, 14 Jan 2008 16:46:40 -0600, "CEV" <chadv.TakeThisOut@advancebkg.com>
>>>> wrote:
>>>>
>>>>> We have a few forms I created in Word. We are currently using Word
>>>>> 2003. There are some check boxes, combo boxes, and text boxes. We
>>>>> protect the document so that users can fill in the form. When
>>>>> protected though, the spell check is lost and we are also not able
>>>>> to use any formatting tools such as bold, the ability to change
>>>>> font and size, and use bullets. How can these options be made
>>>>> available for protected forms?
>>>>>
>>>>> Thank You,
>>>>>
>>>>> CEV
>>>>>
>>>>
>>>> For the spell check, you need the macro in
>>>> http://www.word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm.
>>>>
>>>> Word's form fields don't support font formatting. The closest you
>>>> can come to that is to insert section breaks before and after a
>>>> paragraph, and mark the section between the breaks as unprotected.
>>>> To do that, click Tools > Protect Document and, in the task pane,
>>>> select "Filling in forms" and then click the "Select sections" link
>>>> that appears below it. Uncheck the section between the breaks.
>>>>
>>>> --
>>>> Regards,
>>>> Jay Freedman
>>>> Microsoft Word MVP FAQ: http://word.mvps.org
>>>> Email cannot be acknowledged; please post all follow-ups to the
>>>> newsgroup so all may benefit.
Back to top
Login to vote
CRSA

External


Since: Apr 01, 2008
Posts: 1



(Msg. 12) Posted: Tue Apr 01, 2008 10:39 am
Post subject: Re: formatting and spellcheck in locked forms [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Jay,

I am using MS Word 2003 and we experience the same problem as CEV. I am
trying to implement the workaround you gave him and my task pane does not
have "select sections" link. Also, I am only able to select "filling in
forms" under the Editing restrictions drop down menu. Am I missing something?

"Jay Freedman" wrote:
Word's form fields don't support font formatting. The closest you can come to
that is to insert section breaks before and after a paragraph, and mark the
section between the breaks as unprotected. To do that, click Tools > Protect
Document and, in the task pane, select "Filling in forms" and then click the
"Select sections" link that appears below it. Uncheck the section between the
breaks.

--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the newsgroup so
all
may benefit.

> I don't know what the problem is. Using bullets in an unprotected section of
> a mixed form works ok here. Can you do it by applying the List Bullet style?
>
> CEV wrote:
> > OK, I was able to implement the section breaks. And I'm able to change
> > fonts, bold, etc., but am not able to use bullets in these unprotected
> > section breaks. Is there a reason for this or is there something else
> > I need to do?
> >
> > Thanks,
> >
> > CEV
> >
> > "Jay Freedman" <jay.freedman DeleteThis @verizon.net> wrote in message
> > news:o86oo3dap9lrelg3kbjmuhkv7a7ts4p4kq@4ax.com...
> >> On Mon, 14 Jan 2008 16:46:40 -0600, "CEV" <chadv DeleteThis @advancebkg.com>
> >> wrote:
> >>> We have a few forms I created in Word. We are currently using Word
> >>> 2003. There are some check boxes, combo boxes, and text boxes. We
> >>> protect the document so that users can fill in the form. When
> >>> protected though, the spell check is lost and we are also not able
> >>> to use any formatting tools such as bold, the ability to change
> >>> font and size, and use bullets. How can
> >>> these options be made available for protected forms?
> >>>
> >>> Thank You,
> >>>
> >>> CEV
> >>>
> >>
> >> For the spell check, you need the macro in
> >> http://www.word.mvps.org/FAQs/MacrosVBA/SpellcheckProtectDoc.htm.
> >>
> >> Word's form fields don't support font formatting. The closest you
> >> can come to
> >> that is to insert section breaks before and after a paragraph, and
> >> mark the
> >> section between the breaks as unprotected. To do that, click Tools >
> >> Protect
> >> Document and, in the task pane, select "Filling in forms" and then
> >> click the
> >> "Select sections" link that appears below it. Uncheck the section
> >> between the
> >> breaks.
> >>
> >> --
> >> Regards,
> >> Jay Freedman
> >> Microsoft Word MVP FAQ: http://word.mvps.org
> >> Email cannot be acknowledged; please post all follow-ups to the
> >> newsgroup so all
> >> may benefit.
>
>
>
Back to top
Login to vote
Display posts from previous:   
       Home -> Office -> User Forms All times are: Eastern Time (US & Canada) (change)
Goto page Previous  1, 2
Page 2 of 2

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Categories:
 Windows XP
 Windows Vista
 Windows Other
  Office
 Office Other
 Security
 WinRAR
  • Home |
  • Shareware |
  • Windows Tips |
  • Hot Offers |
  • FREE Newsletters |
  • Arcade |
  • Forums |
  • eBooks |
  • About WUGNET |
  • Partners |
  • Contact

  • WUGNET Privacy Policy |
  • Link to WUGNET