
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,
Thanks for the feedback. We took your idea with respect to the table, and
used parts of your code from the supplied link and came up with a solution.
There is one small problem with our code that we hope that you may have a
work around for. When the userbox is loaded on top of our Word document, we
can't scroll down the document, or see the sentences loading into the
document until we close the userbox. The sentences do end up appearing
where we wish, however, being able to watch them appear, and having the
ability to scroll the document would be helpful. Below is a copy of the
code we are using.
Private Sub CommandButton1_Click()
match = False
keyword = keybox.Text
Set sourcedoc = Documents.Open(FileName:="c:\National\Keyword\Keyword.doc")
For i = 1 To sourcedoc.Tables(1).Rows.Count
Set myitem = sourcedoc.Tables(1).Cell(i - 1, 1).Range
myitem.End = myitem.End - 1
If keyword = myitem.Text Then
match = True
For j = 1 To sourcedoc.Tables(1).Cell(i - 1,
2).Range.Paragraphs.Count
Set myitem = sourcedoc.Tables(1).Cell(i - 1,
2).Range.Paragraphs(j).Range
myitem.End = myitem.End - 1
cboKeyword.AddItem myitem.Text
Next j
End If
Next i
If match = True Then
cboKeyword.Value = "Click for list of matching sentences."
Else
cboKeyword.Value = "No matches found, please try another keyword."
End If
End Sub
Private Sub CommandButton2_Click()
report = cboKeyword.Value
insert = txtNum.Text
Application.ScreenUpdating = False
If insert = 1 Then
ThisDocument.Bookmarks("Def1").Range.Text = report
End If
If insert = 2 Then
ThisDocument.Bookmarks("Def2").Range.Text = report
End If
If insert = 3 Then
ThisDocument.Bookmarks("Def3").Range.Text = report
End If
If insert = 4 Then
ThisDocument.Bookmarks("Def4").Range.Text = report
End If
If insert = 5 Then
ThisDocument.Bookmarks("Def5").Range.Text = report
End If
If insert = 6 Then
ThisDocument.Bookmarks("Def6").Range.Text = report
End If
If insert = 7 Then
ThisDocument.Bookmarks("Def7").Range.Text = report
End If
If insert = 8 Then
ThisDocument.Bookmarks("Def8").Range.Text = report
End If
If insert = 9 Then
ThisDocument.Bookmarks("Def9").Range.Text = report
End If
If insert = 10 Then
ThisDocument.Bookmarks("Def10").Range.Text = report
End If
If insert = 11 Then
ThisDocument.Bookmarks("Def11").Range.Text = report
End If
If insert = 12 Then
ThisDocument.Bookmarks("Def12").Range.Text = report
End If
If insert = 13 Then
ThisDocument.Bookmarks("Def13").Range.Text = report
End If
If insert = 14 Then
ThisDocument.Bookmarks("Def14").Range.Text = report
End If
If insert = 15 Then
ThisDocument.Bookmarks("Def15").Range.Text = report
End If
If insert = 16 Then
ThisDocument.Bookmarks("Def16").Range.Text = report
End If
If insert = 17 Then
ThisDocument.Bookmarks("Def17").Range.Text = report
End If
If insert = 18 Then
ThisDocument.Bookmarks("Def18").Range.Text = report
End If
If insert = 19 Then
ThisDocument.Bookmarks("Def19").Range.Text = report
End If
If insert = 20 Then
ThisDocument.Bookmarks("Def20").Range.Text = report
End If
If insert = 21 Then
ThisDocument.Bookmarks("Def21").Range.Text = report
End If
If insert = 22 Then
ThisDocument.Bookmarks("Def22").Range.Text = report
End If
If insert = 23 Then
ThisDocument.Bookmarks("Def23").Range.Text = report
End If
If insert = 24 Then
ThisDocument.Bookmarks("Def24").Range.Text = report
End If
If insert = 25 Then
ThisDocument.Bookmarks("Def25").Range.Text = report
End If
If insert = 26 Then
ThisDocument.Bookmarks("Def26").Range.Text = report
End If
If insert = 27 Then
ThisDocument.Bookmarks("Def27").Range.Text = report
End If
If insert = 28 Then
ThisDocument.Bookmarks("Def28").Range.Text = report
End If
If insert = 29 Then
ThisDocument.Bookmarks("Def29").Range.Text = report
End If
If insert = 30 Then
ThisDocument.Bookmarks("Def30").Range.Text = report
End If
If insert = 31 Then
ThisDocument.Bookmarks("Def31").Range.Text = report
End If
If insert = 32 Then
ThisDocument.Bookmarks("Def32").Range.Text = report
End If
If insert = 33 Then
ThisDocument.Bookmarks("Def33").Range.Text = report
End If
If insert = 34 Then
ThisDocument.Bookmarks("Def34").Range.Text = report
End If
If insert = 35 Then
ThisDocument.Bookmarks("Def35").Range.Text = report
End If
If insert = 36 Then
ThisDocument.Bookmarks("Def36").Range.Text = report
End If
If insert = 37 Then
ThisDocument.Bookmarks("Def37").Range.Text = report
End If
If insert = 38 Then
ThisDocument.Bookmarks("Def38").Range.Text = report
End If
If insert = 39 Then
ThisDocument.Bookmarks("Def39").Range.Text = report
End If
If insert = 40 Then
ThisDocument.Bookmarks("Def40").Range.Text = report
End If
If insert = 41 Then
ThisDocument.Bookmarks("Def41").Range.Text = report
End If
If insert = 42 Then
ThisDocument.Bookmarks("Def42").Range.Text = report
End If
If insert = 43 Then
ThisDocument.Bookmarks("Def43").Range.Text = report
End If
If insert = 44 Then
ThisDocument.Bookmarks("Def44").Range.Text = report
End If
If insert = 45 Then
ThisDocument.Bookmarks("Def45").Range.Text = report
End If
If insert = 46 Then
ThisDocument.Bookmarks("Def46").Range.Text = report
End If
If insert = 47 Then
ThisDocument.Bookmarks("Def47").Range.Text = report
End If
If insert = 48 Then
ThisDocument.Bookmarks("Def48").Range.Text = report
End If
If insert = 49 Then
ThisDocument.Bookmarks("Man1").Range.Text = report
End If
If insert = 50 Then
ThisDocument.Bookmarks("Man2").Range.Text = report
End If
If insert = 51 Then
ThisDocument.Bookmarks("Man3").Range.Text = report
End If
Application.ScreenUpdating = True
End Sub
Private Sub CommandButton3_Click()
End
End Sub
Private Sub UserForm_Initialize()
Dim sourcedoc As Document, keyword As String, i As Single, j As Single,
myitem As Range, match As Boolean, report As Variant, insert As Integer
End Sub
Thanks,
Rob
>I would go about this as follows:
>
[quoted text clipped - 42 lines]
>>>>
>>>> Any and all input is appreciated.
Doug Robbins - Word MVP - 13 Nov 2005 17:09 GMT
Show the userform modeless
myUserFOrm.Show vbModeless
You can then scroll through the document with the userform displayed on the
screen.

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 - 265 lines]
>>>>>
>>>>> Any and all input is appreciated.
Ro b - 15 Nov 2005 01:14 GMT
Thanks Doug,
Up and running like a charm.
> Show the userform modeless
>
[quoted text clipped - 272 lines]
>>>>>>
>>>>>> Any and all input is appreciated.