Re: Editing document
- From: Fuzzhead <Fuzzhead@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 23 Jan 2007 18:51:01 -0800
Greg,
I reread your post earlier and what I did was disabled the check boxes in
the template so the only way to edit them is to use the form.
"Greg Maxey" wrote:
Fuzzhead,.
I used characters 82 (Checked box) and character 163 (empty box) from
the Wingdings2 font set.
I didn't have to download the font. It came installed with my computer
applications.
Fuzzhead wrote:
Greg,
I looked through my symbols menu and I don't have or can't fined checked or
clear boxes. Where would they be? Are they symbols that I need to down load
from somewhere?
"Greg Maxey" wrote:
Fuzzhead,
I agree with Jay. What is the point of dealing with formfields if you don't
want the users to edit the form using the fields.
Supposing you are still working on the document with the checkboxes, here is
a possible solution displaying checkboxes in the document that interact with
the state of corresponding checkboxes in the userform you use to edit the
document.
First using the insert>symbol menu insert a checked box and and cleared box.
Format the cleard box with bold font. AFAIK, Word has no way of disquishing
between the checkedbox and unchecked box in regular text so I used format
bold to distinquish between the two.
Create an AutoText entry of the Checked box (I named it CB) and create an
entry of the the Unchecked box (I named it UCB).
Now insert the UCB autotext entry at each point in the document that you
want checked or unchecked boxes to appear. Bookmark each entry as CB1, CB2,
CB3, etc.
In the userform add a checkbox for each box in the document. In the
intialize event use:
Private Sub UserForm_Initialize()
Dim oBM As Bookmarks
Dim i As Long
Set oBM = ActiveDocument.Bookmarks
For i = 1 To 2
If oBM("CB" & i).Range.Font.Bold Then
Me.Controls("CheckBox" & i).Value = False
Else
Me.Controls("CheckBox" & i).Value = True
End If
Next i
End Sub
This will set the value of the checkboxes in the form to match the state of
the checkboxes in the document.
In the CommandButton Click event use:
Private Sub CommandButton1_Click()
Dim i As Long
Dim oRng As Word.Range
For i = 1 To 2
Set oRng = ActiveDocument.Bookmarks("CB" & i).Range
If Me.Controls("Checkbox" & i).Value = True Then
ActiveDocument.AttachedTemplate.AutoTextEntries("CB").Insert Where:=oRng,
RichText:=True
oRng.Font.Bold = False
Else
ActiveDocument.AttachedTemplate.AutoTextEntries("UCB").Insert Where:=oRng,
RichText:=True
oRng.Font.Bold = True
End If
ActiveDocument.Bookmarks.Add "CB" & i, oRng
Next i
Me.Hide
End Sub
This will make the checkboxes in the form interact with the state of the
checkboxes in the UserForm
--
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
Fuzzhead wrote:
Hi Jay,
I did that but in the case of the check box it did not work. If I
click on a blank check box it puts a check in the box first and then
opens my form with that same box checked. It does the same also if
the box is checked and I try to remove the check. It will remove the
check first and then open the form with the box not checked in the
form.
"Jay Freedman" wrote:
In the Properties dialog for the form field, open the Enter dropdown
and choose the name of the macro that displays your popup form.
--
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.
Fuzzhead wrote:
I have a document that different group's access to input
information. I created several forms for updating the document
depending on the group. Is there a way that if someone tries to
input information in a text field or check box in the document that
it will not take the info but will open the form instead? An
example would be if I tried to check or uncheck a box, the box
would not take the check or remove it but would open the form
instead.
- References:
- Re: Editing document
- From: Jay Freedman
- Re: Editing document
- From: Greg Maxey
- Re: Editing document
- From: Fuzzhead
- Re: Editing document
- From: Greg Maxey
- Re: Editing document
- Prev by Date: Re: Writing to current Word document
- Next by Date: Re: Spell checking
- Previous by thread: Re: Editing document
- Next by thread: Re: Converting RTF file to Excel
- Index(es):
Relevant Pages
|