你原来的太乱了,我重新写了一个标准的设置方法:
Dim
doc
As
New
PrintDoc
'副标题
Dim rx As prt.RenderText
'定义一个文本对象
Dim rt As New
prt.RenderTable
rx = New prt.RenderText
rx.Text = "主标题"
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '主标题居中
rx.Style.FontSize = 18
'字体大小为18磅
rx.Style.FontBold = True
rx.style.Spacing.Bottom = 5
'和以下对象保持5毫米的距离
Doc.Body.Children.add(rx)
rx = New prt.RenderText
rx.Text = "左标题"
rx.Style.TextAlignHorz = prt.AlignHorzEnum.left '靠左
rx.Style.FontSize = 12
'字体大小为18磅
rt.cells(0,0).RenderObject = rx
rx = New prt.RenderText
rx.Text = "中标题"
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Center '居中
rx.Style.FontSize = 12
'字体大小为18磅
rt.cells(0,1).RenderObject = rx
rx = New prt.RenderText
rx.Text = "右标题"
rx.Style.TextAlignHorz = prt.AlignHorzEnum.Right '靠右
rx.Style.FontSize = 12
'字体大小为18磅
rt.cells(0,2).RenderObject = rx
doc.Body.Children.Add(rt)
doc.preview