📄 crtfdocument.cls
字号:
VERSION 1.0 CLASS
BEGIN
MultiUse = -1 'True
Persistable = 0 'NotPersistable
DataBindingBehavior = 0 'vbNone
DataSourceBehavior = 0 'vbNone
MTSTransactionMode = 0 'NotAnMTSObject
END
Attribute VB_Name = "cRTFDocument"
Attribute VB_GlobalNameSpace = True
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "SavedWithClassBuilder6" ,"Yes"
Attribute VB_Ext_KEY = "Top_Level" ,"Yes"
'#########################################################################
'★★★★★ http://www.cnpopsoft.com [华普软件] ★★★★★
'★★★★★ VB专业论文与源码荟萃 ★★★★★
'#########################################################################
Option Explicit
Private Type ImageSizeInf
Width As Long
Height As Long
End Type
Private Nodes As cRTFNodes '记录节点类型与子ID
Public Texts As cRTFTexts '文本集合
Public Pictures As cRTFPictures '图片集合
Public Tables As cRTFTables '表格集合
Public Paragraphs As cRTFParagraphs '段落集合
'保持属性值的局部变量
Private mvarFileName As String
Private mvarTextRTF As String
Private mRTFHead As String
Private mRTFBody As String
Private mvarPageHead As String
Private mvarPageFooter As String
Private mvarPageNumber As Boolean
Private mvarPageNumberAlign As AlignTypeEnum
Private mvarPageHeadAlign As AlignTypeEnum
Private mvarPageFooterAlign As AlignTypeEnum
Private mvarSpaceBefore As Long
Private mvarSpaceAfter As Long
Private mvarSpaceLine As Long
Private mvarSpaceFirstLine As Long
Private mvarFontSizeDefault As Long
Private mvarDrawingDirection As DrawingDirectionEnum
Private mvarCaption As String
Private mvarDefaultTabWidth As Long
Private mvarViewKind As ViewKindEnum
Private mvarPaperWidth As Long
Private mvarPaperHeight As Long
Private mvarMarginLeft As Long
Private mvarMarginRight As Long
Private mvarMarginTop As Long
Private mvarMarginBottom As Long
Private mvarMarginGutter As Long
Private mvarPageBorderWidth As Long
Private mvarPageBorderStyle As BorderStyleEnum
Private mvarPageBorderColor As ColorEnum
Private mvarPageBorderArt As Long
Private mvarPaperSize As PaperSizeEnum
Private mvarViewScale As Long
Private mvarPageBorderSpace As Long
Public Property Let PageBorderSpace(ByVal vData As Long)
Attribute PageBorderSpace.VB_Description = "页面边框到文本的距离。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PageBorderSpace = 5
mvarPageBorderSpace = vData
End Property
Public Property Get PageBorderSpace() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PageBorderSpace
PageBorderSpace = mvarPageBorderSpace
End Property
Public Property Let PageBorderColor(ByVal vData As ColorEnum)
Attribute PageBorderColor.VB_Description = "页面边框颜色索引。"
'向属性指派对象时使用,位于 Set 语句的左边。
'Syntax: Set x.PageBorderColor = Form1
mvarPageBorderColor = vData
End Property
Public Property Get PageBorderColor() As ColorEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PageBorderColor
PageBorderColor = mvarPageBorderColor
End Property
Public Property Let PageBorderStyle(ByVal vData As BorderStyleEnum)
Attribute PageBorderStyle.VB_Description = "页面边框样式常数。"
'向属性指派对象时使用,位于 Set 语句的左边。
'Syntax: Set x.PageBorderStyle = Form1
mvarPageBorderStyle = vData
End Property
Public Property Get PageBorderStyle() As BorderStyleEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PageBorderStyle
PageBorderStyle = mvarPageBorderStyle
End Property
Public Property Let ViewScale(ByVal vData As Long)
Attribute ViewScale.VB_Description = "文档缩放比例。默认100。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.ViewScale = 5
mvarViewScale = vData
End Property
Public Property Get ViewScale() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.ViewScale
ViewScale = mvarViewScale
End Property
Public Property Let PaperSize(ByVal vData As PaperSizeEnum)
Attribute PaperSize.VB_Description = "页面尺寸常数。1~8,如果为0,则页面尺寸由PaperWidth与PaperHeight决定。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PaperSize = 5
mvarPaperSize = vData
End Property
Public Property Get PaperSize() As PaperSizeEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PaperSize
PaperSize = mvarPaperSize
End Property
Public Property Let PageBorderArt(ByVal vData As Long)
Attribute PageBorderArt.VB_Description = "艺术性边框的类型。1~165。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PageBorderArt = 5
mvarPageBorderArt = vData
End Property
Public Property Get PageBorderArt() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PageBorderArt
PageBorderArt = mvarPageBorderArt
End Property
Public Property Let PageBorderWidth(ByVal vData As Long)
Attribute PageBorderWidth.VB_Description = "页面边框宽度。0~75。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PageBorderWidth = 5
mvarPageBorderWidth = vData
End Property
Public Property Get PageBorderWidth() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PageBorderWidth
PageBorderWidth = mvarPageBorderWidth
End Property
Public Property Let MarginGutter(ByVal vData As Long)
Attribute MarginGutter.VB_Description = "装订线位置。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MarginGutter = 5
mvarMarginGutter = vData
End Property
Public Property Get MarginGutter() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MarginGutter
MarginGutter = mvarMarginGutter
End Property
Public Property Let MarginBottom(ByVal vData As Long)
Attribute MarginBottom.VB_Description = "下边距。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MarginBottom = 5
mvarMarginBottom = vData
End Property
Public Property Get MarginBottom() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MarginBottom
MarginBottom = mvarMarginBottom
End Property
Public Property Let MarginTop(ByVal vData As Long)
Attribute MarginTop.VB_Description = "上边距。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MarginTop = 5
mvarMarginTop = vData
End Property
Public Property Get MarginTop() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MarginTop
MarginTop = mvarMarginTop
End Property
Public Property Let MarginRight(ByVal vData As Long)
Attribute MarginRight.VB_Description = "右边距。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MarginRight = 5
mvarMarginRight = vData
End Property
Public Property Get MarginRight() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MarginRight
MarginRight = mvarMarginRight
End Property
Public Property Let MarginLeft(ByVal vData As Long)
Attribute MarginLeft.VB_Description = "左边距。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.MarginLeft = 5
mvarMarginLeft = vData
End Property
Public Property Get MarginLeft() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.MarginLeft
MarginLeft = mvarMarginLeft
End Property
Public Property Let PaperHeight(ByVal vData As Long)
Attribute PaperHeight.VB_Description = "页高。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PaperHeight = 5
mvarPaperHeight = vData
End Property
Public Property Get PaperHeight() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PaperHeight
PaperHeight = mvarPaperHeight
End Property
Public Property Let PaperWidth(ByVal vData As Long)
Attribute PaperWidth.VB_Description = "页宽。单位:缇。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.PaperWidth = 5
mvarPaperWidth = vData
End Property
Public Property Get PaperWidth() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.PaperWidth
PaperWidth = mvarPaperWidth
End Property
Public Property Let ViewKind(ByVal vData As ViewKindEnum)
Attribute ViewKind.VB_Description = "视图模式。0~5。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.ViewKind = 5
mvarViewKind = vData
End Property
Public Property Get ViewKind() As ViewKindEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.ViewKind
ViewKind = mvarViewKind
End Property
Public Property Let DefaultTabWidth(ByVal vData As Long)
Attribute DefaultTabWidth.VB_Description = "默认Tab宽度。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.DefaultTabWidth = 5
mvarDefaultTabWidth = vData
End Property
Public Property Get DefaultTabWidth() As Long
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.DefaultTabWidth
DefaultTabWidth = mvarDefaultTabWidth
End Property
Public Property Let Caption(ByVal vData As String)
Attribute Caption.VB_Description = "文档窗体标题。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.Caption = 5
mvarCaption = vData
End Property
Public Property Get Caption() As String
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.Caption
Caption = mvarCaption
End Property
Public Property Let DrawingDirection(ByVal vData As DrawingDirectionEnum)
Attribute DrawingDirection.VB_Description = "绘图方向。默认为水平绘图。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.DrawingDirection = 5
mvarDrawingDirection = vData
End Property
Public Property Get DrawingDirection() As DrawingDirectionEnum
'检索属性值时使用,位于赋值语句的右边。
'Syntax: Debug.Print X.DrawingDirection
DrawingDirection = mvarDrawingDirection
End Property
Public Property Let FontSizeDefault(ByVal vData As Long)
Attribute FontSizeDefault.VB_Description = "默认字体尺寸。一般为9(小五)。"
'向属性指派值时使用,位于赋值语句的左边。
'Syntax: X.FontSizeDefault = 5
mvarFontSizeDefault = vData
End Property
Public Property Get FontSizeDefault() As Long
'检索属性值时使用,位于赋值语句的右边。
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -