📄 crtfcell.cls
字号:
'Syntax: X.NoWrap = 5
mvarNoWrap = vData
End Property
Public Property Get NoWrap() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.NoWrap
NoWrap = mvarNoWrap
End Property
Public Property Let FitText(ByVal vData As Boolean)
Attribute FitText.VB_Description = "文本自动适应单元格宽度。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.FitText = 5
mvarFitText = vData
End Property
Public Property Get FitText() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.FitText
FitText = mvarFitText
End Property
Public Property Let DataType(ByVal vData As CellContentTypeEnum)
Attribute DataType.VB_Description = "单元格内容类型。0-简单文本,1-高级文本,2-图片,3-嵌套表格"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.DataType = 5
mvarDataType = vData
End Property
Public Property Get DataType() As CellContentTypeEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.DataType
DataType = mvarDataType
End Property
Public Property Let Data(ByVal vData As Variant)
Attribute Data.VB_Description = "单元格内容数据。与DataType相关联,DataType取值可以是:0-简单文本,1-高级文本,2-图片,3-嵌套表格"
Attribute Data.VB_UserMemId = 0
'向属性指派对象时使用,位于 Set 语句的左边。
'Syntax: Set x.Data = Form1
Select Case mvarDataType
Case cct1_段落
Set mvarData = New cRTFText
Set mvarData = vData
mvarData.IsInTable = True
Case cct2_图片
Set mvarData = New cRTFPicture
Set mvarData = vData
mvarData.IsInTable = True
Case cct3_表格
Set mvarData = New cRTFTable
Set mvarData = vData
mvarData.Nested = True
Case Else '否则为简单文本
mvarData = vData
mvarText = vData
End Select
End Property
Public Property Set Data(ByVal vData As Variant)
'向属性指派对象时使用,位于 Set 语句的左边。
'Syntax: Set x.Data = Form1
Select Case mvarDataType
Case cct1_段落
Set mvarData = New cRTFText
Set mvarData = vData
mvarData.IsInTable = True
Case cct2_图片
Set mvarData = New cRTFPicture
Set mvarData = vData
mvarData.IsInTable = True
Case cct3_表格
Set mvarData = New cRTFTable
Set mvarData = vData
mvarData.Nested = True
Case Else '否则为简单文本
mvarData = vData
mvarText = vData
End Select
End Property
Public Property Get Data() As Variant
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Data
If IsObject(mvarData) Then
Set Data = mvarData
Else
Data = mvarData
End If
End Property
Public Property Let Col(ByVal vData As Long)
Attribute Col.VB_Description = "当前的列值。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Col = 5
mvarCol = vData
End Property
Public Property Get Col() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Col
Col = mvarCol
End Property
Public Property Let Row(ByVal vData As Long)
Attribute Row.VB_Description = "行数。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Row = 5
mvarRow = vData
End Property
Public Property Get Row() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Row
Row = mvarRow
End Property
Public Property Let Merge(ByVal vData As Boolean)
Attribute Merge.VB_Description = "水平与前一单元格合并。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Merge = 5
mvarMerge = vData
End Property
Public Property Get Merge() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Merge
Merge = mvarMerge
End Property
Public Property Let MergeStart(ByVal vData As Boolean)
Attribute MergeStart.VB_Description = "水平合并的第一个单元格。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MergeStart = 5
mvarMergeStart = vData
End Property
Public Property Get MergeStart() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MergeStart
MergeStart = mvarMergeStart
End Property
Public Property Let MergeV(ByVal vData As Boolean)
Attribute MergeV.VB_Description = "垂直与前一单元格合并。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MergeV = 5
mvarMergeV = vData
End Property
Public Property Get MergeV() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MergeV
MergeV = mvarMergeV
End Property
Public Property Let MergeVStart(ByVal vData As Boolean)
Attribute MergeVStart.VB_Description = "垂直合并的第一个单元格。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MergeVStart = 5
mvarMergeVStart = vData
End Property
Public Property Get MergeVStart() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MergeVStart
MergeVStart = mvarMergeVStart
End Property
Public Property Let Right(ByVal vData As Long)
Attribute Right.VB_Description = "单元格右边界位置。CellX"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Right = 5
mvarRight = vData
End Property
Public Property Get Right() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Right
Right = mvarRight
End Property
Public Property Let WidthUnit(ByVal vData As CellLengthUnitEnum)
Attribute WidthUnit.VB_Description = "单元格首选宽度单位,0~3,默认:3"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.WidthUnit = 5
mvarWidthUnit = vData
End Property
Public Property Get WidthUnit() As CellLengthUnitEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.WidthUnit
WidthUnit = mvarWidthUnit
End Property
Public Property Let Width(ByVal vData As Long)
Attribute Width.VB_Description = "单元格首选宽度。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Width = 5
mvarWidth = vData
End Property
Public Property Get Width() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Width
Width = mvarWidth
End Property
Public Property Let CellPatForeColor(ByVal vData As ColorEnum)
Attribute CellPatForeColor.VB_Description = "单元格底纹前景色索引值。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.CellPatForeColor = 5
mvarCellPatForeColor = vData
End Property
Public Property Get CellPatForeColor() As ColorEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.CellPatForeColor
CellPatForeColor = mvarCellPatForeColor
End Property
Public Property Let CellPatBackColor(ByVal vData As ColorEnum)
Attribute CellPatBackColor.VB_Description = "单元格底纹线条颜色索引值。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.CellPatBackColor = 5
mvarCellPatBackColor = vData
End Property
Public Property Get CellPatBackColor() As ColorEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.CellPatBackColor
CellPatBackColor = mvarCellPatBackColor
End Property
Public Property Let CellPatType(ByVal vData As PatTypeEnum)
Attribute CellPatType.VB_Description = "单元格底纹类型。1~12。默认:0"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.CellPatType = 5
mvarCellPatType = vData
End Property
Public Property Get CellPatType() As PatTypeEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.CellPatType
CellPatType = mvarCellPatType
End Property
Public Property Let BorderColor(ByVal vData As ColorEnum)
Attribute BorderColor.VB_Description = "边框颜色索引值。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderColor = 5
mvarBorderColor = vData
End Property
Public Property Get BorderColor() As ColorEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderColor
BorderColor = mvarBorderColor
End Property
Public Property Let BorderStyle(ByVal vData As BorderStyleEnum)
Attribute BorderStyle.VB_Description = "边框类型。1~28种类型。默认:0"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderStyle = 5
mvarBorderStyle = vData
End Property
Public Property Get BorderStyle() As BorderStyleEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderStyle
BorderStyle = mvarBorderStyle
End Property
Public Property Let BorderLeftUp(ByVal vData As Boolean)
Attribute BorderLeftUp.VB_Description = "是否显示单元格内左上斜线/。默认为:False"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderLeftUp = 5
mvarBorderLeftUp = vData
End Property
Public Property Get BorderLeftUp() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderLeftUp
BorderLeftUp = mvarBorderLeftUp
End Property
Public Property Let BorderLeftDown(ByVal vData As Boolean)
Attribute BorderLeftDown.VB_Description = "是否显示单元格内左下斜线\\。默认为:False"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderLeftDown = 5
mvarBorderLeftDown = vData
End Property
Public Property Get BorderLeftDown() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderLeftDown
BorderLeftDown = mvarBorderLeftDown
End Property
Public Property Let BorderBottom(ByVal vData As Boolean)
Attribute BorderBottom.VB_Description = "是否显示单元格下边框。默认:True"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderBottom = 5
mvarBorderBottom = vData
End Property
Public Property Get BorderBottom() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderBottom
BorderBottom = mvarBorderBottom
End Property
Public Property Let BorderTop(ByVal vData As Boolean)
Attribute BorderTop.VB_Description = "是否显示单元格上边框。默认:True"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderTop = 5
mvarBorderTop = vData
End Property
Public Property Get BorderTop() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderTop
BorderTop = mvarBorderTop
End Property
Public Property Let BorderRight(ByVal vData As Boolean)
Attribute BorderRight.VB_Description = "是否显示单元格右边框。默认:True"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderRight = 5
mvarBorderRight = vData
End Property
Public Property Get BorderRight() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderRight
BorderRight = mvarBorderRight
End Property
Public Property Let BorderLeft(ByVal vData As Boolean)
Attribute BorderLeft.VB_Description = "是否显示单元格左边框。默认:True"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.BorderLeft = 5
mvarBorderLeft = vData
End Property
Public Property Get BorderLeft() As Boolean
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.BorderLeft
BorderLeft = mvarBorderLeft
End Property
Public Property Let Alignment(ByVal vData As AlignTypeEnum)
Attribute Alignment.VB_Description = "单元格水平对齐。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Alignment = 5
If mvarDataType = cct2_图片 Then
mvarData.Alignment = vData
ElseIf mvarDataType = cct3_表格 Then
'表格对齐方式:
'mvarData.Alignment = vData
Else '默认为文本方式:
If IsObject(mvarData) Then mvarData.Alignment = vData
End If
mvarAlignment = vData
End Property
Public Property Get Alignment() As AlignTypeEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Alignment
Alignment = mvarAlignment
End Property
Public Property Let AlignmentV(ByVal vData As AlignVTypeEnum)
Attribute AlignmentV.VB_Description = "单元格垂直对齐。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.AlignmentV = 5
mvarAlignmentV = vData
End Property
Public Property Get AlignmentV() As AlignVTypeEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.AlignmentV
AlignmentV = mvarAlignmentV
End Property
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -