[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 177
  • Last Modified:

Bolding selected text in a text box..

I have a paragraph table that has codes and text.  I want to be able to allow the user to enter in the paragraph and bold the necessary text at the vb end.  Can I use a regular text box and give them a bold button similar to word.

Can I do this and save it to sql server.  The paragraphs are used in a word merge.

1 Solution
No, you will have to use a Richtext box

Then in code

With RTB1
  .SelBold = True  'changes selected text to bolded
End With
You can not mark only one word, and bold it. But, you can Bold whole text! Use code like this:

Private Sub Command1_Click()
Text1.FontBold = True
End Sub

It's pretty easy, isn't it? (and it works in regular textbox!)
Best regards, Daky
kiprimshotAuthor Commented:

yeah...... I know how to bold all text
IN an RTF box you can set individual words to bold. I have done this but sometimes (I dont know why) it get a bit flaky.

Use SelStart to find the start of the work/phrase you want bold. Use SelLength to select that word or phrase.

You can then use the SelBold command to set that selection to bold.

Good Luck
kiprimshotAuthor Commented:
sorry for the wait I havent been off for a while

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now