> Ok thanks I will try that method.
>
[quoted text clipped - 66 lines]
> > > --
> > > K Hogwood-Thompson- Hide quoted text -- Show quoted text -
Sorry about the lack of relevance there Greg,
I am not using a protected word for, the reason why is that when populating
it with the code that I attached in my original post, I get the error message
telling me that it cannot insert data into a protected area.
Is there any way around this, such as unprotecting the bookmarked areas?

Signature
K Hogwood-Thompson
> That doesn't really answer my question ;-)
>
[quoted text clipped - 82 lines]
> > > > --
> > > > K Hogwood-Thompson- Hide quoted text -- Show quoted text -
Greg Maxey - 31 Jan 2007 10:25 GMT
Yes there is:
If ActiveDocument.ProtectionType <> wdNoProtection Then
ActiveDocument.Unprotect
End If
'Your code
ActiveDocument.Protect wdAllowOnlyFormFields, NoReset:=True
I've been playing around with another method that I like. Create two
autotext entries, one of a checked box symbole, and one of an empty box
symbol. (actually you could use any two symbols you like.) Be sure to store
the autotext entries in the template for your form (not Normal.dot).
Before actuallly saving the autotext entries, format the empty box sympbol
with font.color = wdColorAutomatic (will be black in the vast majority of
cases). Format the checked box symbol with font.color = wdColorBlack
Next place the empty box symbol (using Insert>Autotext) in the document at
each location a interactive empty/checked box needs to appear. Select at
bookmark the symbol CB1, then use CB2, etc.
In your UserForm, use a Checkbox to correspond with each CB in the document.
Private i As Long
Private Sub UserForm_Initialize()
Dim oBM As Bookmarks
Set oBM = ActiveDocument.Bookmarks
For i = 1 To 3 'or to however many checkboxes you are using.
If oBM("CB" & i).Range.Font.Color = wdColorAutomatic Then
Me.Controls("CheckBox" & i).Value = False
Else
Me.Controls("CheckBox" & i).Value = True
End If
Next i
End Sub
The initialize event above sets the UserForm Controls to match the "empty"
state of the checkboxes in any new document. If you use are allowing your
users to "edit" an existing document then the userform checkboxes will be
set to the checked or unchecked value of the CBs in the form.
This is the code to process the form:
Private Sub CommandButton1_Click()
Dim oRng As Word.Range
For i = 1 To 3
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.Color = wdColorBlack
Else
ActiveDocument.AttachedTemplate.AutoTextEntries("UCB").Insert Where:=oRng,
RichText:=True
oRng.Font.Color = wdColorAutomatic
End If
ActiveDocument.Bookmarks.Add "CB" & i, oRng
Next i
Me.Hide
End Sub

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> Sorry about the lack of relevance there Greg,
>
[quoted text clipped - 93 lines]
>>>>> --
>>>>> K Hogwood-Thompson- Hide quoted text -- Show quoted text -