Convert System.Color To Microsoft Word WdColor

前端 未结 3 777
半阙折子戏
半阙折子戏 2021-01-17 19:47

I\'m rather new to C# and find it almost unspeakable that there isn\'t a simple way for converting an RGB color or system.color to a WdColor!

VB is simple, C# - is i

3条回答
  •  梦谈多话
    2021-01-17 20:13

    Color c = Colors.Blue;
    var wdc = (Microsoft.Office.Interop.Word.WdColor)(c.R + 0x100 * c.G + 0x10000 * c.B);
    

提交回复
热议问题