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 / March 2007

Tip: Looking for answers? Try searching our database.

Clear button for text box

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
call_me_sol@yahoo.com - 03 Mar 2007 01:59 GMT
Hi -

I have a simple find/replace textbox that I use to replace specific
bookmarks within a document.  Currently, user inputs values into the
text box, hits a button, and the various bookmarks are replaced with
the contents of the text box.

Now, I want to add a CLEAR button to my text box so the user can start
over. Please note that I only want to wipe out the contents of the
text box (not the entire document) so the user has a fresh text box
with which to start.

One problem, though, is that my current code automatically closes the
text box after all of the replacements have taken place.  I need the
auto-close feature to stop.

Here is my existing code:

Private Sub CommandButton1_Click()
Dim oRng As Word.Range
Dim oBMs As Bookmarks
Set oBMs = ActiveDocument.Bookmarks
Set oRng = oBMs("RD").Range
oRng.Text = TextBox1
oBMs.Add "RD", oRng
Set oRng = oBMs("DOS").Range
oRng.Text = TextBox3
Set oRng = Nothing
Set oBMs = Nothing
Unload Me
End Sub

Thank you for any help provided!
Jezebel - 03 Mar 2007 02:35 GMT
Answered elsewhere

> Hi -
>
[quoted text clipped - 29 lines]
>
> Thank you for any help provided!
 
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.