assigning code to textbox clicks

C

coach_mikey

Hi all.

I have code that successully (thanks Perry!) allows a user to
simultaneously view a Word document and add customized textboxes to the
document via a Userform. The userform contains dropdowns and a text
entry box. Based on what the user enters/selects on the userform, the
customized textbox displays that information.
But now I need to allow the user to edit the contents of that textbox,
but using the same userform. How can I assign a generic click-event to
these textboxes which have been inserted into the word document?
Also, any suggestions on how to allow the user to easily
minimize/maximize the textboxes with single clicks?
Below is the code that creates each textbox. Thanks!

Private Sub cmdNewComment_Click()
Set myTextBox = ActiveDocument.Shapes.AddTextbox( _
Orientation:=msoTextOrientationHorizontal, _
Left:=InchesToPoints(-1), _
Top:=InchesToPoints(0), _
Width:=InchesToPoints(0.8), _
Height:=InchesToPoints(1.5), _
Anchor:=Selection.Range)
With myTextBox.Fill
.ForeColor.RGB = RGB(0, 350, 0)
.BackColor.RGB = RGB(250, 120, 250)
End With
myTextBox.AutoShapeType = msoShapeRectangle
With myTextBox.TextFrame.TextRange
.Text = "Comment #1" & vbCrLf & "XYZ Issue"
.Font.Name = "Arial"
.Font.Size = 8
.Bold = True
myTextBox.TextFrame.WordWrap = True
myTextBox.TextFrame.AutoSize = True
End With
Selection.Range.HighlightColorIndex = wdTeal
End Sub
 
P

Perry

You can't assign a Click event to a Texframe.
Can you rephrase/-peat the purpose of the desired action behind clickevent
(had the been possible)
-------------------------------------
Krgrds,
Perry

System parameters:
POS: WinXP SP2
MSO: MSOffice 2003 SP2
DEV: VS8 (dotnet)
 
C

coach_mikey

Hi Perry. I'm sorry I didn't see your response earlier. I completely
missed it.

The overall purpose of this app is to allow a user to review a word doc
created by someone else. This reviewer then highlights certain text in
the document and makes comments on that highlighted text. I know that
Word already has this feature, but the customer needs something
customized. The reviewer will use a customized userform that contains
several comment categories in dropdown boxes (e.g., Severity of Comment
-- High, Medium, Low). After the reviewer selects info in the dropdown
boxes, the app creates a little textbox next to the comment that
contains the information that was selected.
Eventually, a master reviewer will need to combine comments from
multiple reviewers into a single document, but that's another mountain
to climb.
I'm still struggling with how, once a comment (textbox) is created by
the reviewer, it can be edited by the reviewer clicking on it and
pulling up the same userform with the dropdown boxes. I'm also
struggling with moving all these textboxes into a seperate, vertical
frame to the left of the main document so that the reviewer can make
his/her comments without them getting in the way of the document they
are reviewing.
This textbox approach seemed to me to be the best way to approach this,
but maybe some other method would be better?
 
P

Perry

Been offline for a week or so.
couldn't follow up sooner.

Pls clarify:
a UserForm is a dialog screen that will popup when called for.
A UserForm is created in the development environment of MS Word also called
VBE.
In MS Word, press ALT+F11 to view this environment.
(in VBE, press ALT+F11 to return to MS Word)

I don't think y're referering to a UserForm created in this environment.
Y're refering to a document (form) that is used for users to input
information, correct?

If not, y'll have to elaborate some more.

Krgrds,
Perry
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top