html text property,Text Property

Text Property

07/11/2006

2 minutes to read

In this article

Some of the content in this topic may not be applicable to some languages.

BalloonLabel or BalloonCheckbox object: Returns or sets the text displayed next to a check box or label in the Office Assistant balloon. Read/write String.

Balloon object: Returns or sets the text displayed after the heading but before the labels or check boxes in the Office Assistant balloon. Read/write String.

CommandBarComboBox object: Returns or sets the text in the display or edit portion of the command bar combo box control. Read/write String.

HTMLProjectItem object: Returns or sets the HTML text in the HTML editor. Read/write String.

expression.Text

*expression   * Required. An expression that returns one of the objects in the Applies To list.

Remarks

For the Balloon, BalloonLabel, and BalloonCheckbox objects, you can specify that a particular graphic be displayed by using the following syntax: {type location sizing_factor}, where type is bmp (bitmap) or wmf (Windows metafile); location is the resource ID or the path and file name; and sizing_factor denotes the width of the .wmf file (sizing_factor is omitted for .bmp files).

The Balloon object also supports underlined text and text that has one of the 16 system palette colors applied to it. To display underlined text, use the syntax {ul} or {ul 1}; use {ul 0} to turn underlining off. To change the color of text, precede the text string with the character sequence {cf number}, where number is one of the system color numbers listed in the following table.

System color number

Color

0

Black

1

Dark red

2

Dark green

3

Dark yellow

4

Dark blue

5

Dark magenta

6

Dark cyan

7

Light gray

248

Medium gray

249

Red

250

Green

251

Yellow

252

Blue

253

Magenta

254

Cyan

255

White

If you specify a number other than one of the preceding system color numbers, the text in the Office Assistant balloon is black.

Example

This example creates a new command bar named "Custom" and adds to it a combo box that contains four list items. The example then uses the Text property to set Item 3 as the default list item.

Set myBar = CommandBars _

.Add(Name:="Custom", Position:=msoBarTop, _

Temporary:=True)

With myBar

.Controls.Add Type:=msoControlComboBox, ID:=1

.Visible = True

End With

Set testComboBox = CommandBars("Custom").Controls(1)

With testComboBox

.AddItem "Item 1", 1

.AddItem "Item 2", 2

.AddItem "Item 3", 3

.AddItem "Item 4", 4

.Text = "Item 3"

End With

This example creates a new Office Assistant balloon with a heading, text, and three region choices. The example uses the Text property to provide balloon-related instructions to the user and a label for each text box.

With Assistant.NewBalloon

.Heading = "Regional Sales Data"

.Text = "Select a region"

For i = 1 To 3

.CheckBoxes(i).Text = "Region " & i

Next

.Show

End With

This example creates a new Office Assistant balloon that contains underlined heading text, red text, and blue text that is also underlined.

With Assistant.NewBalloon

.Heading = "Underlined {ul 1}Heading{ul 0}"

.Text = "Some {cf 249}Red{cf 0} text and some " & _

"underlined {cf 252}{ul 1}Blue{ul 0}{cf 0} text."

.Show

End With

This example creates a new Office Assistant balloon that contains a Windows metafile.

With Assistant.NewBalloon

.Heading = "Underlined {ul 1}Heading{ul 0}"

.Text ="{WMF ""C:\Favorites\MyPicture.WMF""}"

.Show

End With

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值