1º Cria o campo do tipo COLOR, o nome vai ser 'campoColor';
2º Cria um campo computado, do tipo NUMBER com a opção 'Allow multiple values' com a formula abaixo:
t_txtRed := @Middle(campoColor; 2; 2);
t_txtGreen := @Middle(campoColor; 4; 2);
t_txtBlue := @Middle(campoColor ; 6; 2);
t_txtHexa := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9":"A":"B":"C":"D":"E":"F";
t_txtDec := "0":"1":"2":"3":"4":"5":"6":"7":"8":"9":"10":"11":"12":"13":"14":"15";
t_cRed := @TextToNumber(@Replace(@Left(t_txtRed ; 1) ; t_txtHexa ; t_txtDec)) * 16 + @TextToNumber(@Replace(@right(t_txtRed ; 1) ; t_txtHexa ; t_txtDec));
t_cGreen := @TextToNumber(@Replace(@Left(t_txtGreen ; 1) ; t_txtHexa ; t_txtDec)) * 16 + @TextToNumber(@Replace(@right(t_txtGreen ; 1) ; t_txtHexa ; t_txtDec));
t_cBlue := @TextToNumber(@Replace(@Left(t_txtBlue ; 1) ; t_txtHexa ; t_txtDec)) * 16 + @TextToNumber(@Replace(@right(t_txtBlue ; 1) ; t_txtHexa ; t_txtDec));
t_cRed : t_cGreen : t_cBlue
3º Agora basta definir com a classe 'NotesColorObject':
Dim session = new NotesSession
Dim colorObject As NotesColorObject
Set colorObject = Session.CreateColorObject
Call colorObject.SetRGB(doc.campoColor(0),doc.campoColor(1),doc.campoColor(2))
Nenhum comentário:
Postar um comentário