VC如何设置Excel单元格内某个字的格式,比如单元格有3个字我只给其中一个字加下划线
VC如何设置Excel2003单元格内某个字的格式,比如单元格有’ABC‘个字,如何只给其中的'A'加下划线,如何设置其中某些字的格式,哪位大哥帮忙解决下,小弟不胜感激。最好是VC,其他的有的话发过来参考下,网上实在找不到资料
Font可以改变整个单元格的字体格式,但是如何改变单元格内一部分内容的格式呐???
Font ft;
ft.AttachDispatch(m_ExlRge.GetFont());
ft.SetName(_variant_t("宋体"));//字体
ft.SetColorIndex(_variant_t((long)11));//字的颜色
ft.SetSize(_variant_t((long)12));//字号
ft.SetUnderline(_variant_t((long)2));//下划线
With Selection.Font
.Name = "隶书"
.Size = 14
.Strikethrough = False
.Superscript = False
.Subscript = False
.OutlineFont = False
.Shadow = False
.Underline = xlUnderlineStyleNone
.ColorIndex = xlAutomatic
End With
Selection.Font.Bold = True
Selection.Font.ColorIndex = 3
ActiveCell.Characters(Start:=起始位置, Length:=1).Font.underline=