It says it all in the booklet but I couldn't find it and was totally screwed when the remote suddenly stopped working with the TV.
I have an Insignia HDTV and although there's a code for it (1437) in the User Guide, it didn't work! I then found the auto-search feature and it worked!
This search code works for the TV and the DVD mode.
So for the TV you first turn on the TV, then press and hold the TV mode key. While holding the TV mode key also press and hold the OK key. Release both keys and all the mode keys blink twice. Enter 922 by pressing the numeric keys on the remote. The TV mode key blinks twice to indicate a successful entry. Point the remote toward the TV and press play. I had to hold it to make it work. Once the TV turns off press Enter (at the bottom right). So this worked for me. Now I wanted to control the Power button for both the set-top-box (receiver/PVR) and the TV at once. To do this you have to press the STB mode key on the remote. Without releasing the STB mode key, press and hold the OK key. Release both keys and all mode keys blink twice. Enter the programming code 977. The STB mode key blinks twice. For the deconf device, press the applicable mode key (TV, DVD or AUX). The selected mode key blinks twice. You can select all three (TV, DVD or AUX) devices. Press Enter top complete the power switch control programming. The last selected mode key blinks three timesto indicate a successfull entry.