问题
In an MS-Access RichTextBox on a Report, I want to make a selection of the text bold.
I found this post on a forum which explains how to do this in VB6. I tried the same in MS-Access, both with a normal Access textbox with the Text Format
property set to Rich Text
and a Microsoft Forms 2.0 TextBox
added via the ActiveX Controls
dialogue box, neither works.
I know VBA is based heavily on VB6 so my logic is if it can be done in VB6, I should be able to do it in Access.
Am I right? Is it possible to set a selection of text to bold inside a RichTextBox on MS-Access?
回答1:
You do not mention the version of Access, for 2007 (AFAIK) and 2010, you can create a textbox and set the Text Format on the data tab to Rich Text. You can then set the Control Source to:
="The quick <b>brown</b> fox"
In table design, the memo data type has a Rich Text option.
From Rich formatted text that includes data from fields
For a number of reasons the rich text control doesn't support the full range of HTML but rather a limited subset of HTML focused around formatting text. If you stick to the list of HTML tags and attributes below you should be safe:
<font face="Arial Black" size=3 color="#A5A5A5" style="Background-Color:#FFFF00">
<strong>
<em>
<u>
<br>
<div align=right dir=RTL>
<blockquote>
<ol> and <li> for number
<ul> and <li> for bulleted lists
来源:https://stackoverflow.com/questions/12561633/set-a-selection-of-text-to-bold-inside-a-richtextbox