We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Setting color (ASP Classic)

This doesn't seem too difficult but fails when trying to set the color :

Set objWord = CreateObject("Aspose.Words.ComHelper")
Set objDoc = objWord.Open(myTempName)
Set builder = CreateObject("Aspose.Words.DocumentBuilder")
builder.Document = objDoc
builder.font.bold=true
builder.font.Name = "Wingdings"
builder.font.Size = 10
builder.font.Color = RGB(50,100,150) <== error '80131509'
builder.Write("ⁿ")

I also can't get to ANYTHING concerning "System.Drawing". What's the trick?







Hi Bill,

Thanks for your inquiry. Color is not enumeration - it is a structure. It is marshalled as OLE_COLOR in COM Interop. Please try ColorTranslator.ToOle method to translate the specified Color structure to an OLE color or use Color Constants like vbBlack, vbRed. Hope this helps you.