基本上,想要选择一行并居中对齐每个单元格的内容,但似乎无法让它工作。什么都不做:
For r = 1 To rCount
wd.ActiveDocument.Tables(c).Cell(r, 1).Select
textVal = wd.Selection.Text
If textVal Like "Job*" Then
wd.Selection.Font.Allcaps = True
wd.ActiveDocument.Tables(c).Rows(r).Alignment = wdAlignRowCenter
End If
Next
在wd.ActiveDocument.Tables(c).Rows(r).Alignment = wdAlignRowCenter
似乎只是说说自己的网页,而不是内容上对齐的行。我只能找到一个单元格的文档,而不是整行。
有什么建议么?
您需要更改段落格式,而不是表格对齐方式:
With wd.ActiveDocument.Tables(c)
For r = 1 To .Rows.Count
With .Cell(r, 1)
If InStr(.Range.Text, "Job") = 1 Then
.Range.Font.AllCaps = True
.Row.Range.ParagraphFormat.Alignment = wdAlignParagraphCenter
End If
End With
Next
End With
另请注意,无需选择任何内容。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句