Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / January 2006

Tip: Looking for answers? Try searching our database.

assigning code to textbox clicks

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
coach_mikey - 16 Dec 2005 20:45 GMT
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
Perry - 18 Dec 2005 04:35 GMT
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)
-------------------------------------
> Hi all.
>
[quoted text clipped - 33 lines]
> Selection.Range.HighlightColorIndex = wdTeal
> End Sub
coach_mikey - 12 Jan 2006 15:45 GMT
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?
Perry - 14 Jan 2006 10:54 GMT
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

> Hi Perry.  I'm sorry I didn't see your response earlier.  I completely
> missed it.
[quoted text clipped - 20 lines]
> This textbox approach seemed to me to be the best way to approach this,
> but maybe some other method would be better?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.