文档详情

word宏,让表格居中.doc

发布:2016-12-23约9.78千字共38页下载文档
文本预览下载声明
word宏,让表格居中 篇一:Microsoft Word 中用宏给所有表格设置边框 Microsoft Word 中用宏给所有表格设置边框 Sub 宏1() #39; #39; 宏1 宏 #39; #39; For Each aTable In ActiveDocument.Tables #39; aTable.Borders.OutsideLineStyle = wdLineStyleSingle #39; aTable.Borders.OutsideLineWidth = wdLineWidth025pt #39; #39;#39; aTable.Borders.InsideLineStyle = wdLineStyleSingle #39;#39; aTable.Borders.InsideLineStyle = wdLineWidth025pt With aTable aTable.Select With .Borders(wdBorderLef t) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderRight) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderTop) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderBottom) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderHorizontal) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With With .Borders(wdBorderVertical) .LineStyle = wdLineStyleSingle .LineWidth = wdLineWidth050pt .Color = wdColorAutomatic End With .Borders(wdBorderDiagonalDown).LineStyle = wdLineStyleNone.Borders(wdBorderDiagonalUp).LineStyle = wdLineStyleNone.Borders.Shadow = False End With With Options .DefaultBorderLineStyle = wdLineStyleSingle .DefaultBorderLineWidth = wdLineWidth050pt .DefaultBorderColor = wdColorAutomatic End With Next aTable End Sub 篇二:宏录制:统一调整表格格式 在我们的实际工作中经常需要对文本进行排版,对于文字部分用格式刷即可以解决问题,但对于文本表格的调整就较为繁琐,整个文本不下几十个的表格逐一进行选择、设置、调整通常占用很长的时间,掌握宏制作后该项工作将变的简便,且调整后的格式肯定统一,美观。 具体操作如下 1、将表格自Excel复制至Word文档 2、选中需要处理的表格,进行宏的录制,选择工具——宏——录制新宏 3、在弹出的对话框中输入宏名(自己定义即可)在这里命名为表格) 4、点击上图工具栏左边的符号,弹出如下对话框 5、选择工具栏选项,新建一个工具栏用来放置宏命令,名称随意(在这里称为调整表格),工具栏名称下面有工具栏可用于选项,可以设置为本文档也可以设置为Word的典型模板即Normal.dot,一般我们保存在Word的模板中,以后在其他文档中使用时就可以不用再建了。 6、再回到命令栏,将表格调整的命令拉到新建的工具栏内,关闭对话框即可开始录制宏 7、对表格进行调整,一步步进行,注意:在宏录制过程中鼠标右键是无法使用
显示全部
相似文档