Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Spell Checking Text Boxes?

My text boxes are now all from the Shapes or Forms toolbars. I believe the
objects are the same. Alongside each box I have a button for spell
checking. The macro the button called had the text box's name to know which
to select and check. The sheet is protected. I thought I could have a
single macro that with Selection.Name could determine where the user was
and then use that to select the shape to check. But it seems that when
protected you can't read the Selection.Name.

Okay, so I can go back to my old way. But even then it is less than
perfect. After checking the spelling the textbox is left with the fuzzy
line around it. When the user leaves the box it does go away, but returns
when the box is reselected. The box is no longer protected. It can be
moved. But only once. Then this goes away and it becomes a normal protected
box.

I then decided to see what a text box from the control toolbox would do. Of
course this means much more complexity. I created a box. It has WordWrap =
True. MultiLine = True. EnterKeyBehavior = True. SelectionMargin = False.
One quirk I see is if there is more text than can be shown, the hidden text
is from the top. Then why does the box and text increase in size slightly
when selected? And then I get back to my original question and just how
would I spell check these?

Don <donwiss at panix.com.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,758
Default Spell Checking Text Boxes?

I'm not sure what textboxes you're using.

I put a couple of textboxes from the Drawing toolbar onto a worksheet. I put a
couple of buttons from the Forms toolbar onto the sheet (adjacent to the
textboxes).

But I named each nicely.

the buttons were named: button_001 and button_002
the textboxes were named: textbox_001 and textbox_002

Then I could use those suffixes from the button's name to determine which
textbox to spellcheck.

I put this in a general module:

Option Explicit
Sub testme()

Dim myBTN As Button
Dim mySFX As String
Dim myTB As TextBox

Set myBTN = ActiveSheet.Buttons(Application.Caller)
mySFX = Right(myBTN.Name, 3)
Set myTB = ActiveSheet.TextBoxes("TextBox_" & mySFX)

myTB.CheckSpelling

End Sub

And assigned it to both buttons.



Don Wiss wrote:

My text boxes are now all from the Shapes or Forms toolbars. I believe the
objects are the same. Alongside each box I have a button for spell
checking. The macro the button called had the text box's name to know which
to select and check. The sheet is protected. I thought I could have a
single macro that with Selection.Name could determine where the user was
and then use that to select the shape to check. But it seems that when
protected you can't read the Selection.Name.

Okay, so I can go back to my old way. But even then it is less than
perfect. After checking the spelling the textbox is left with the fuzzy
line around it. When the user leaves the box it does go away, but returns
when the box is reselected. The box is no longer protected. It can be
moved. But only once. Then this goes away and it becomes a normal protected
box.

I then decided to see what a text box from the control toolbox would do. Of
course this means much more complexity. I created a box. It has WordWrap =
True. MultiLine = True. EnterKeyBehavior = True. SelectionMargin = False.
One quirk I see is if there is more text than can be shown, the hidden text
is from the top. Then why does the box and text increase in size slightly
when selected? And then I get back to my original question and just how
would I spell check these?

Don <donwiss at panix.com.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 300
Default Spell Checking Text Boxes?

On Sun, 26 Dec 2004, Dave Peterson wrote:

I'm not sure what textboxes you're using.


When I wrote Shapes and Forms I meant from the Drawing and Forms toolbars.

I put a couple of textboxes from the Drawing toolbar onto a worksheet. I put a
couple of buttons from the Forms toolbar onto the sheet (adjacent to the
textboxes).

But I named each nicely.

the buttons were named: button_001 and button_002
the textboxes were named: textbox_001 and textbox_002


Clever.

Then I could use those suffixes from the button's name to determine which
textbox to spellcheck.

I put this in a general module:

Option Explicit
Sub testme()

Dim myBTN As Button
Dim mySFX As String
Dim myTB As TextBox

Set myBTN = ActiveSheet.Buttons(Application.Caller)
mySFX = Right(myBTN.Name, 3)
Set myTB = ActiveSheet.TextBoxes("TextBox_" & mySFX)

myTB.CheckSpelling

End Sub

And assigned it to both buttons.


This works fine. Thanks. What I had been doing is to select the shape, then
run the spell check on it. By avoiding the selection you avoided the
problem I was having. While this way is fine, I had been hoping to replace
all the alongside buttons and have a single button on my toolbar. But that
would require the user to have the focus in the text box. My old way, a
macro for each text box, and your enhancement, allows for the focus to be
anywhere. This is better. So I will go with this and drop the toolbar idea.

Don <donwiss at panix.com.
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check in Text Boxes Lee Ann[_2_] Excel Worksheet Functions 18 August 20th 09 09:32 PM
Spell Checking with checking cell notes jfitzpat Excel Discussion (Misc queries) 0 August 8th 07 10:26 PM
spell checking options dvs_47 Excel Worksheet Functions 2 March 6th 06 09:16 PM
Spell checking text boxes Don Wiss Excel Programming 4 December 5th 03 10:52 AM


All times are GMT +1. The time now is 03:57 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"