Sub-宏表格排.docx_第1页
Sub-宏表格排.docx_第2页
Sub-宏表格排.docx_第3页
Sub-宏表格排.docx_第4页
全文预览已结束

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

Sub 宏表格排版() 开始编辑宏第八部分 设置表格边框和底纹 Selection.Tables(1).Select 选中表格 With Selection.Tables(1) 在选中的表格中操作 .Borders(wdBorderLeft).LineStyle = wdLineStyleNone 左边线无 .Borders(wdBorderRight).LineStyle = wdLineStyleNone 右边线无 With .Borders(wdBorderTop) 选择上边线 .LineStyle = wdLineStyleSingle 选择单线 .LineWidth = wdLineWidth150pt 选择1.5磅 .Color = wdColorAutomatic 颜色自动 End With With .Borders(wdBorderBottom) 选择底边线 .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth150pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) 选择中间水平线 .LineStyle = wdLineStyleDot 选择细虚线 .LineWidth = wdLineWidth050pt 选择0.5磅 .Color = wdColorAutomatic 颜色选自动 End With With .Borders(wdBorderVertical) 选择中间垂直线 .LineStyle = wdLineStyleDot .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone .Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone .Borders.Shadow = False 边界无填充 End With With Options .DefaultBorderLineStyle = wdLineStyleDot .DefaultBorderLineWidth = wdLineWidth050pt .DefaultBorderColor = wdColorAutomatic End With第一部分 设置首列 Selection.Tables(1).Select 选中表格 Selection.HomeKey Unit:=wdLine 选择第一单元格 Selection.SelectColumn 选中首列 Selection.SelectCell 选中首列单元格 Selection.ParagraphFormat.Alignment = wdAlignParagraphJustify 水平向前 Selection.Columns.PreferredWidthType = wdPreferredWidthPoints 设置首列度量单位为厘米 Selection.Columns.PreferredWidth = CentimetersToPoints(5) 设置首列宽度为5厘米第七部分 设置首行居中 重复标题行 Selection.Tables(1).Select 选中表5格 Selection.HomeKey Unit:=wdLine 选择第一单元格 Selection.SelectRow 选中首行 Selection.Rows.HeadingFormat = True 重复标题行 Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter 首行水平居中 第一部分 设置段落Selection.Tables(1).Select With Selection.ParagraphFormat .LeftIndent = CentimetersToPoints(0) 左缩进0字符 .RightIndent = CentimetersToPoints(0.1) 右缩进0字符 .SpaceBefore = 0 间距段前0行 .SpaceBeforeAuto = False .SpaceAfter = 0 间距段后0行 .SpaceAfterAuto = False .LineSpacingRule = wdLineSpaceMultiple 设置多倍行距 .LineSpacing = LinesToPoints(1.15) 设置行距1.15倍 .WidowControl = False .KeepWithNext = False .KeepTogether = False .PageBreakBefore = False .NoLineNumber = False .Hyphenation = True .FirstLineIndent = CentimetersToPoints(0) .OutlineLevel = wdOutlineLevelBodyText .CharacterUnitLeftIndent = 0 .CharacterUnitRightIndent = 0 .CharacterUnitFirstLineIndent = 0 .LineUnitBefore = 0 .LineUnitAfter = 0 .MirrorIndents = False .TextboxTightWrap = wdTightNone .AutoAdjustRightIndent = False .DisableLineHeightGrid = True .FarEastLineBreakControl = True .WordWrap = True 自动换行 .HangingPunctuation = True .HalfWidthPunctuationOnTopOfLine = False .AddSpaceBetweenFarEastAndAlpha = True .AddSpaceBetweenFarEastAndDigit = True .BaseLineAlignment = wdBaselineAlignAuto End With 第二部分 设置字体、字号、背景色、垂直 Selection.Tables(1).Select Selection.Font.Size = 9 设置字号为小五 Selection.Font.Name = 宋体 设置字体为仿宋国标 Selection.Font.Name = Arial Narrow 设置字体为罗马体(针对字母和数字) Options.DefaultHighlightColorIndex = wdNoHighlight Selection.Range.HighlightColorIndex = wdNoHighlight Selection.Shading.Texture = wdTextureNone Selection.Shading.ForegroundPatternColor = wdColorAutomatic 以白色突出显示文本 Selection.Shading.BackgroundPatternColor = -603914241 底纹为白色第三部分 设置表格属性 Selection.Tables(1).Select With Selection.Tables(1) .TopPadding = CentimetersToPoints(0) 设置上边距为0 .BottomPadding = CentimetersToPoints(0) 设置下边距为0 .LeftPadding = CentimetersToPoints(0) 设置左边距为0 .RightPadding = CentimetersToPoints(0) 设置右边距为0 .Spacing = CentimetersToPoints(0) 允许单元格间距为0 .AllowPageBreaks = True 允许断页 .AllowAutoFit = True 允许自动重调尺寸 Selection.Tables(1).Rows.Alignment = wdAlignRowLeft 表格对齐方式为左对齐 Selection.Tables(1).Rows.WrapAroundText = False 不允许文字环绕 Selection.Tables(1).Rows.LeftIndent = CentimetersToPoints(0.1) 缩进量为0 Selection.Tables(1).PreferredWidthType = wdPreferredWidthPoints Selection.Tables(1).PreferredWidth = CentimetersToPoints(14.5) 表格列宽为15厘米 End With Selection.Rows.HeightRule = wdRowHeightAtLeast 设置行高值为最小值 Selection.Rows.Height = CentimetersToPoints(0.65) 设置行高值为0.65厘米

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

最新文档

评论

0/150

提交评论