WPS 用录制新宏功能录制的宏好像不会包含搜索的颜色信息,研究了半天才搞明白。感觉节省的时间可能小于研究的时间,感觉有点亏。为了最大化这部分经验的价值所以发出来了。具体是怎么搞明白的已经忘了,倒霉。
核心的语句是这个:obj.ColorIndex = wdRed;
function 搜索红色内容()
{
Selection.Find.Wrap = wdFindContinue;
Selection.Find.Wrap = wdFindContinue;
(obj=>{
obj.ColorIndex = wdRed;
obj.Underline = 9999999;
obj.EmphasisMark = 9999999;
obj.SmallCaps = 0;
obj.AllCaps = 0;
//obj.DisableCharacterSpaceGrid = false;
obj.NameFarEast = "";
obj.NameAscii = "";
obj.NameOther = "";
obj.NameBi = "";
obj.Bold = wdUndefined;
obj.Italic = wdUndefined;
obj.BoldBi = wdUndefined;
obj.ItalicBi = wdUndefined;
obj.Subscript = wdUndefined;
obj.Superscript = wdUndefined;
obj.StrikeThrough = wdUndefined;
obj.DoubleStrikeThrough = wdUndefined;
obj.SmallCaps = wdUndefined;