我有一个宏,它创建一个有 2 列的表。我想使文本居中。
我需要知道执行此操作的实际功能/方法(即未记录),因为我正在 Microsoft Word 之外的特定工具中编辑复杂的宏。
Function TableStyleApply(oTable)
Const wdLineWidth050pt = 4
Const wdLineStyleSingle = 1
Const wdBorderTop = -1
Const wdBorderLeft = -2
Const wdBorderBottom = -3
Const wdBorderRight = -4
Const wdBorderHorizontal = -5
Const wdBorderVertical = -6
Const wdAlignParagraphCenter = 100
oTable.Borders(wdBorderTop ).LineStyle = wdLineStyleSingle
oTable.Borders(wdBorderLeft ).LineStyle = wdLineStyleSingle
oTable.Borders(wdBorderBottom ).LineStyle = wdLineStyleSingle
oTable.Borders(wdBorderRight ).LineStyle = wdLineStyleSingle
oTable.Borders(wdBorderHorizontal).LineStyle = wdLineStyleSingle
oTable.Borders(wdBorderVertical).LineStyle = wdLineStyleSingle
oTable.Rows(1).Range.Font.Bold = True
oTable.Rows(1).Shading.BackgroundPatternColor = 15132390
oTable.Rows.LeftIndent = 43
oTable.Columns(1).SetWidth 280, 2
oTable.Columns(2).SetWidth 157, 2
oTable.Columns.ParagraphFormat.Alignment = wdAlignParagraphCenter
End Function