有关WordApplication、WordDocument的页面设置问题?

Michaelyfj 2001-07-23 04:21:04
在Delphi5.0中,利用WordApplication和WordDocument来打印风格自由的报表。
但在页面设置中,我想把它分成两列来打印,请教在Delphi中如何控制,如下的
打印格式:

aaaaaaaaaa bbbbbbbbb
aaaaaaaaaa ccccccccc
dddddddddd eeeeeeeee
ffffffffff ggggggggg
即第1列打印到页底时,再打印第2列
...全文
132 3 打赏 收藏 转发到动态 举报
写回复
用AI写文章
3 条回复
切换为时间正序
请发表友善的回复…
发表回复
newyj 2001-07-29
  • 打赏
  • 举报
回复
word编程比较简单;只要录制宏;再对应过来即可

{'
' Macro3 Macro
' 宏在 2001-7-24 由 yj 录制
'
Application.PrintOut FileName:="", Range:=wdPrintRangeOfPages, Item:= _
wdPrintDocumentContent, Copies:=1, Pages:="11", PageType:=wdPrintAllPages _
, ManualDuplexPrint:=False, Collate:=True, Background:=True, PrintToFile _
:=False, PrintZoomColumn:=0, PrintZoomRow:=0, PrintZoomPaperWidth:=0, _
PrintZoomPaperHeight:=0
}
FileName:=''; Range:='4'{wdPrintRangeOfPages}; Item:='0';//wdPrintDocumentContent;
Copies:='1'; Pages:='2'; PageType:='0';//wdPrintAllPages;
ManualDuplexPrint:=False; Collate:=True; Background:=True;

PrintToFile :=False; PrintZoomColumn:=0; PrintZoomRow:=0;
PrintZoomPaperWidth:=0;
PrintZoomPaperHeight:=0 ;
append:=false;
from:=2;
to_:=2;
app.PrintOut(Background,Append , Range, filename, from, to_, Item, Copies, Pages, PageType, PrintToFile, Collate, FileName, EmptyParam, ManualDuplexPrint)
Michaelyfj 2001-07-24
  • 打赏
  • 举报
回复
给分!
后面还有问题要问你!
问题:在delphi中,如何设置WordDocument的页码?
新问题,有高分相送!
newyj 2001-07-23
  • 打赏
  • 举报
回复
先录宏
' 宏在 2001-7-23 由 yj 录制
'
With ActiveDocument.PageSetup
.LineNumbering.Active = False
.Orientation = wdOrientPortrait
.TopMargin = CentimetersToPoints(2.54)
.BottomMargin = CentimetersToPoints(2.54)
.LeftMargin = CentimetersToPoints(3.17)
.RightMargin = CentimetersToPoints(3.17)
.Gutter = CentimetersToPoints(0)
.HeaderDistance = CentimetersToPoints(1.5)
.FooterDistance = CentimetersToPoints(1.75)
.PageWidth = CentimetersToPoints(21)
.PageHeight = CentimetersToPoints(29.7)
.FirstPageTray = wdPrinterDefaultBin
.OtherPagesTray = wdPrinterDefaultBin
.SectionStart = wdSectionNewPage
.OddAndEvenPagesHeaderFooter = False
.DifferentFirstPageHeaderFooter = False
.VerticalAlignment = wdAlignVerticalTop
.SuppressEndnotes = False
.MirrorMargins = False
.TwoPagesOnOne = False
.GutterPos = wdGutterPosLeft
With .TextColumns
.SetCount NumColumns:=2
.EvenlySpaced = True
End With
.CharsLine = 20
.LayoutMode = wdLayoutModeDefault
End With

delphi中;
WordDocument1.PageSetup.TextColumns.SetCount(2):即可

5,388

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧