⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rmball.prg

📁 一个用vf6.0编写的学生管理系统。包括 登录 、系统维护、数据处理、 资料查询、报表打印、系统帮助等功能。
💻 PRG
字号:
oWord = CREATEOBJECT("Word.Application")
oWord.visible=.t.
oWord.documents.add
oWord.ActiveWindow.View.Type=3


Wait window "正在设置页面..." nowait
With oWord.ActiveDocument.PageSetup
	.LineNumbering.Active = .F.
	.TopMargin = 72
	.BottomMargin = 72
	.LeftMargin = 90
	.RightMargin = 90
	.Gutter = 0
	.HeaderDistance = 42.55
	.FooterDistance = 49.6
	.PageWidth = 595.35
	.PageHeight = 841.95
	.OddAndEvenPagesHeaderFooter = .F.
	.DifferentFirstPageHeaderFooter = .F.
	.SuppressEndnotes = .F.
	.MirrorMargins = .F.
	.TwoPagesOnOne = .F.
Endwith


Wait window "正在生成标题..." nowait
oWord.Selection.TypeParagraph
oWord.Selection.font.bold=.T.
oWord.Selection.font.name='仿宋'
oWord.Selection.font.size=23
oWord.Selection.typetext("                花 名 册")
oWord.Selection.TypeParagraph

Wait window "正在设置字体..." nowait
oWord.Selection.font.name='宋体'
oWord.Selection.font.size=10.5
oWord.Selection.font.bold=.F.
oWord.Selection.TypeParagraph


Wait window "正在生成表格..." nowait
oWord.ActiveDocument.Tables.Add(oWord.Selection.Range,reccount()+1,3)


Wait window "正在添加表头..." nowait
oWord.ActiveDocument.Tables(1).Cell(1,1).Range.InsertAfter("学号")
oWord.ActiveDocument.Tables(1).Cell(1,1).Select
oWord.Selection.Cells.VerticalAlignment = 1
oWord.Selection.ParagraphFormat.Alignment = 1
oWord.ActiveDocument.Tables(1).Cell(1,2).Range.InsertAfter("姓名")
oWord.ActiveDocument.Tables(1).Cell(1,2).Select
oWord.Selection.Cells.VerticalAlignment = 1
oWord.Selection.ParagraphFormat.Alignment = 1
oWord.ActiveDocument.Tables(1).Cell(1,3).Range.InsertAfter("班级")
oWord.ActiveDocument.Tables(1).Cell(1,3).Select
oWord.Selection.Cells.VerticalAlignment = 1
oWord.Selection.ParagraphFormat.Alignment = 1
For i=1 to reccount()
    Go i
    
    
    Wait window "正在生成第"+allt(str(i))+"行数据..." nowait
    oWord.ActiveDocument.Tables(1).Cell(i+1,1).Range.InsertAfter(学号)
    oWord.ActiveDocument.Tables(1).Cell(i+1,1).Select
    oWord.Selection.Cells.VerticalAlignment = 1
    oWord.Selection.ParagraphFormat.Alignment = 1
    oWord.ActiveDocument.Tables(1).Cell(i+1,2).Range.InsertAfter(姓名)
    oWord.ActiveDocument.Tables(1).Cell(i+1,2).Select
    oWord.Selection.Cells.VerticalAlignment = 1
    oWord.Selection.ParagraphFormat.Alignment = 1
    oWord.ActiveDocument.Tables(1).Cell(i+1,3).Range.InsertAfter(专业、班级)
    oWord.ActiveDocument.Tables(1).Cell(i+1,3).Select
    oWord.Selection.Cells.VerticalAlignment = 1
    oWord.Selection.ParagraphFormat.Alignment = 1
Endfor
oWord.Selection.movedown(7,1)


Wait window "正在添加页码..." nowait
mypagenum=oWord.Selection.Sections(1).Headers(1).PageNumbers
mypagenum.NumberStyle=0
mypagenum.HeadingLevelForChapter=0
mypagenum.IncludeChapterNumber=.f.
mypagenum.ChapterPageSeparator=0
mypagenum.RestartNumberingAtSection=.f.
mypagenum.StartingNumber=0
oWord.Selection.Sections(1).Footers(1).PageNumbers.Add (1,.t.)

Wait window "完成..." time 0.5
oWord.quit














⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -