Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我对 MS Word 文档格式感兴趣。我正在 C# 上开发插件,想知道如何以编程方式在某些单词下绘制波浪红线?
当前代码:
Word.Range targetWord; targetWord.Font.Color = wdColor.wdColorRed;
对象targetWord在哪里Range
targetWord
Range
要在单词下划线,请使用:
targetWord.Underline = Microsoft.Office.Interop.Word.WdUnderline.wdUnderlineSingle;
参考: http: //msdn.microsoft.com/en-us/library/microsoft.office.interop.word.range.underline (v=office.11).aspx
使用 Word = Microsoft.Office.Interop.Word;
要为单词添加颜色下划线,您应该使用: targetWord.Font.ColorIndex = Word.WdColorIndex.wdRed;