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:

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

  • Interpreting your code is a bit challenging because we can't know exactly what data is being passed into the ADDTABLE message. It might help if you could just post the actual RTF strings that your code is producing.
  • Thank you. I don't see anything wrong with the string. I'm not an RTF expert, but once upon a time I went through much of what you have described. I can't recall using it in the OIPI before, but I have used it in RTF editboxes in OI. I remember the days of relying upon WordPad to get clean RTF strings...at least much cleaner than Word!

    For sanity checking, have you tried to test any of the sample strings that are included in the ENABLERTF documentation?
  • FYI:- I tested in my proc where I was using \b and changed to \red and it did not change for me either.
  • Cheers both.

    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.

Sign In or Register to comment.