Re: How to create a window showing building block organiser in 2007



You could use a UserForm, displayed as modeless, that contains a combobox, a
multiline textbox and a command button named cmbAutotext, txtAutotextValue
and cmdInsertComment respectively and have the following code in the User
Form

Private Sub cmbAutotext_Change()
With Me.cmbAutotext
.BoundColumn = 2
Me.txtAutotextValue.Text = .Value
End With
End Sub

Private Sub cmdInsertComment_Click()
ActiveDocument.Comments.Add Range:=Selection.Range,
Text:=txtAutotextValue.Text
End Sub

Private Sub UserForm_Initialize()
For i = 1 To NormalTemplate.AutoTextEntries.Count
With NormalTemplate.AutoTextEntries(i)
Me.cmbAutotext.AddItem .Name
Me.cmbAutotext.List(Me.cmbAutotext.ListCount - 1, 1) = .Value
End With
Next i
End Sub

The Initialize statement will load the combobox with the names of the
autotext entries, when an entry is selected in the Combobox, its value will
be displayed in the textbox and clicking on the command button will insert a
comment containing the selected autotext at the location of the selection.

--
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

"Peter" <Peter@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:08B11F64-1B6E-4214-A23D-EDBB44105796@xxxxxxxxxxxxxxxx
Ideally I would like the window to be formated similiat to the autotext
entry
in Word 2003 e.g. shows the list of names of the items then a preview of
the
contents of the item. Ideally it would be a modeless window that could
float
over the application but this is not necessary. The basic context is that
I
use Word Autotext enties to insert comments into documents when making
assignments.

It works very well in Word 2003 (the autotext box allows you to easily key
through the enteries and the preview that is shown is large enough to read
the entries) but in 2007 it is not as easy to use (the names are not shown
in
a list and the entries are not large enough to read). About 13 minutes
into
the screeen movie at http://baker-evans.com/marker%27s-assistant/demo.html
there is a demo.

Any assistance woudl be gratefully received,
Pete Evans


.