I would do but need to keep the same colours as in our web application which our customer has specified and they can change through the application at any time. The colours work correctly in our web application but they are being translated to hex values (such as #D6D7D6) before the bgcolor of the cell is set.
If I take the HTML for the table that our application creates on a webform (the word doc is an "output" of the webpage) and use InsertHTML on it the colours are being correctly imported (or at least are very close) - unfortunately the HTML tables formatting goes wrong so we can't use that method. Is there any way to specify a hex value or similar when setting the colour directly?
Also, if you are having problems with InsertHtml tables formatting and are using the latest version of Aspose.Word please send us the part of your project sufficient to reproduce the problem.
I am reading the colour values from a field in a table and so am using a single 32bit ARGB value since the table contains both named colours and the colours my customer wants to use. Using a single value is a valid way of creating a colour so I don't see a problem with it.
I am using the latest version so I have attached the HTML that is causing me problems - just do an InsertHTML on it and compare the results to what is shown in IE. Some of the formatting is lost because you don't support the elements that I am using, which is fine, but some of the cells are also lost completely.
Back to my original problem, is there any way to specify a hex value or similar when setting the colour directly since I presume that you are converting/using the hex colour from the HTML in the InsertHTML call to set the imported cells?
Using Color.FromArgb(16711680) is equivalent to Color.FromArgb(0, 255, 0, 0) in .NET, which means you are setting alpha channel to full transparnency. I don't think it is what you want. So, if you want to use a single 32bit RGB value at least add 0xFF000000 before using it in Color.FromArgb call.
You're right that wasn't what I wanted and it works when I set the alpha to 255. It didn't affect the HTML output because the alpha is ignored when its converted.