作者shipship (Ship)
看板Visual_Basic
标题Re: [VBA ] 如何将替换的文字改变颜色
时间Tue Jul 22 22:55:38 2008
试试看这个:
With objSelection.Find.Replacement
If cheSelect(0).Value = 1 Then .Color = picColor(0).BackColor
'网底色彩
If cheSelect(1).Value = 1 Then .Shading.BackgroundPatternColor =
picColor(1).BackColor
'框线色彩
If cheSelect(2).Value = 1 Then .Borders.OutsideLineStyle =
wdLineStyleSingle: .Borders.OutsideColor = picColor(2).BackColor
'底线
If cheSelect(3).Value = 1 Then .Underline = wdUnderlineSingle
'粗体
If cheSelect(4).Value = 1 Then .Bold = True
'斜体
If cheSelect(5).Value = 1 Then .Italic = True
End With
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 59.115.76.99
※ 编辑: shipship 来自: 59.115.76.99 (07/22 22:56)
1F:→ shipship:你的程式应该在for前面设定即可 07/22 23:38
2F:推 mnb7120:大大,好像还是不行耶~! 07/22 23:44
3F:→ shipship:你把原程式中下面这行拿掉试试看: 07/23 16:04
4F:→ shipship:objSelection.Find.Font.ColorIndex = wdRed 07/23 16:04
5F:推 mnb7120:谢谢shipship,已经解决了.... 07/30 01:38