作者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