在Word我们通常在VBA或VB.NET环境下以如下方式查找Wingdings符号

        Dim wdApp As Word.Application = Globals.ThisDocument.ApplicationDim wdDoc As Word.Document = wdApp.ActiveDocumentDim wdRange As Word.Range = wdDoc.Range()Dim M As MatchDim Character As StringDim P As Word.ParagraphDim wdLine As Word.WdUnits = Word.WdUnits.wdLineDim wdCharacter As Word.WdUnits = Word.WdUnits.wdCharacterDim wdExtend As Word.WdMovementType = Word.WdMovementType.wdExtendDim count As Integer = 1'Chr(&HFE) 对应一个wingdings符号Character = Chr(&HFE)wdRange.Select()With wdApp.Selection.Find.Text = Character.Forward = True.Wrap = Word.WdFindWrap.wdFindStop.Execute()End With'以下用来移除那个符号所在的行wdApp.Selection.HomeKey(wdLine, Type.Missing)wdApp.Selection.MoveDown(wdLine, count, wdExtend)wdApp.Selection.Delete(wdCharacter, Type.Missing)

可是你会发现在C#中你靠"0xFE"(与VB中的“&HFE"是对应的)并不能找到相应的符号。实际上这里应该在前面加上"F0”成为"0xF0FE"这样就能找到相应的符号了。代码如下(以下代码与上面的代码是等效的):

	    object missing = Type.Missing;Word.Application wdApp = Globals.ThisDocument.Application;Word.Document wdDoc = wdApp.ActiveDocument;Word.Range wdRange = wdDoc.Range(wdDoc.Content.Start,wdDoc.Content.End);object FindText = Convert.ToChar(0xF0FE);            wdRange.Select();wdApp.Selection.Find.Text = FindText.ToString();wdApp.Selection.Find.Forward = true;wdApp.Selection.Find.Wrap = Word.WdFindWrap.wdFindStop;object wdLine = Word.WdUnits.wdLine;object wdExtend = Word.WdMovementType.wdExtend;object count = 1;while (wdApp.Selection.Find.Execute()){wdApp.Selection.HomeKey(ref wdLine, ref missing);wdApp.Selection.MoveDown(ref wdLine, ref count, ref wdExtend);wdApp.Selection.Delete();}

转载于:https://www.cnblogs.com/mksword/archive/2012/12/31/3934020.html