Welcome to the SRP Forum! Please refer to the SRP Forum FAQ post if you have any questions regarding how the forum works.
ENABLERTF in OIPI
I am trying to change the color of just a few particular words in a cell in a Table in an OIPI if they appear.
Basically I am doing this:
I worked out I had to brace the whole cell so now things like underlining just a few words (like above) works but trying to change color for those words (\red) does not. (It also now does not resolve the CRLF$ since I braced the whole cell)
I eventually created a RTF in Wordpad and looked at that and there was obviously quite a bit of metadata.
It noted '\red255\green0\blue0' so I tried variations with no joy.
In case it is important, FontCond1 is just defined at standard Arial, 10pt. Nothing more.
What am I doing wrong?
Basically I am doing this:
If MatCurPurchNos EQ "" then
If trim(MatLastPurchNo) NE "" then MatLastPurchNo = CRLF$: " Purchase No: ":MatLastPurchNo
end else
MatLastPurchNo = CRLF$: " Purchase No: " : MatCurPurchNos : " - {\ul Undelivered Purchase Order}"
end
MatTableData<MatCnt, 3> = "{ [":MatCodeDescs<1,y>:"]" : MatLastPurchNo:"}"
x = Set_Printer("FONT", FontCond1)
x = Set_Printer("ENABLERTF", 1)
x = Set_Printer("ADDTABLE", MatTableDims, MatTableHead, MatTableData, "", "", 0, 9)
x = Set_Printer("ENABLERTF", 0)
I worked out I had to brace the whole cell so now things like underlining just a few words (like above) works but trying to change color for those words (\red) does not. (It also now does not resolve the CRLF$ since I braced the whole cell)
I eventually created a RTF in Wordpad and looked at that and there was obviously quite a bit of metadata.
It noted '\red255\green0\blue0' so I tried variations with no joy.
In case it is important, FontCond1 is just defined at standard Arial, 10pt. Nothing more.
What am I doing wrong?
Comments
For sanity checking, have you tried to test any of the sample strings that are included in the ENABLERTF documentation?
Most of my knowledge is from the EnableRTF documentation @DonBakke!
That, plus the examples we have around the place. We do EnableRTF bolding and whatnot elsewhere but surprisingly not for color. Where we do change color in an OIPI its normally its own thing and we just use an RGB on the Font for that.
Can't say I have ever had this usecase before (or maybe I just never tried so hard to do it after I hit the wall)
The 'clean' RTF string from Wordpad still had a lot more going on than I expected. You are right Don, at least its not Word.