Show us the code that you are using.

Signature
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
Doug
I'm following your previous advice and I've created DocVariable fields
throughout my word doc. I had problems leaving thanks at the previous
message, so I now do -thank you.
The part I need help on consists of a series of checkboxes/textboxes as
follows:
Risk Register
[] [description]
chk1 txt1
chk2 txt2
chk3 txt3
chk4 txt4
Outputs go to docVariable Opt10a - Opt10d respectively.
As I previously stated I would like to omit gaps between the docVariables in
a table along with having the opportunity of reducing whitespace in other
areas of the document, where their Fields remain empty.
I thought about having a single row and adding new rows (or returning) after
each non-blank item is added along with the next docVariable being added to
the next row (or line)?
I have a Sub Initialise() routine in the ThisDocument object which contains
various lines to reload data from the docVariables to the userform. And I
have an action on the form's Okay button, to update the values of the
docVariables, as follows:
Sub Initialise()
'Risks
If ThisDocument.Variables("Opt10a").Value = "" Then
frmMain.chk1.Value = False
frmMain.txt1.Value = ""
Else
frmMain.chk1.Value = True
frmMain.txt1.Value = ThisDocument.Variables("Opt10a").Value
End If
If ThisDocument.Variables("Opt10b").Value = "" Then
frmMain.chk2.Value = False
frmMain.txt2.Value = ""
Else
frmMain.chk2.Value = True
frmMain.txt2.Value = ThisDocument.Variables("Opt10b").Value
End If
If ThisDocument.Variables("Opt10c").Value = "" Then
frmMain.chk3.Value = False
frmMain.txt3.Value = ""
Else
frmMain.chk3.Value = True
frmMain.txt3.Value = ThisDocument.Variables("Opt10c").Value
End If
If ThisDocument.Variables("Opt10d").Value = "" Then
frmMain.chk4.Value = False
frmMain.txt4.Value = ""
Else
frmMain.chk4.Value = True
frmMain.txt4.Value = ThisDocument.Variables("Opt10d").Value
End If
'***********************************************************
Private Sub cmd1_Click()
'Risks
If frmMain.chk1.Value = True Then
ThisDocument.Variables("Opt10a").Value = frmMain.txt1.Value
End If
If frmMain.chk2.Value = True Then
ThisDocument.Variables("Opt10b").Value = frmMain.txt2.Value
End If
If frmMain.chk3.Value = True Then
ThisDocument.Variables("Opt10c").Value = frmMain.txt3.Value
End If
If frmMain.chk4.Value = True Then
ThisDocument.Variables("Opt10d").Value = frmMain.txt4.Value
End If
Kind regards
Dylan Dawson
> Show us the code that you are using.
>
[quoted text clipped - 8 lines]
> > Kind Regards
> > DDawson
Doug Robbins - Word MVP - 31 Jan 2008 19:44 GMT
You may need to do some "post processing":
Dim af As Field
With ActiveDocument
For Each af In .Fields
If af.Type = wdFieldDocVariable Then
If af.Result.Text = "" Then
If af.Result.Information(wdWithInTable) = True Then
af.Result.Rows(1).Delete
End If
End If
End If
Next af
End With

Signature
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
> Doug
>
[quoted text clipped - 100 lines]
>> > Kind Regards
>> > DDawson