Hi guys,
I'm back with a new question. I really need some help with the print
function in TB, I'm kind of lost in manipulating the content of the
message.
I made a new entry on the contextual menu for printing the selected
text. I've made the selection part, I captured the selected text but
now i need to pass it to the printing function. I don't know how to do
that, all I have managed to do is to display the selected text into
the message window ,the PrintEnginePrintPreview function displays the
whole content of the message.I guess i need to alter a specific
parameter of that function (content.document ?). Where should I look
for finding out how the printing process works and which parameters
are used? Here is the code of the function, maybe there is just a
simple thing that I've missed out:

printSelection : function() {
try {

var s = window.content.getSelection().getRangeAt(0);
var contents = s.cloneContents();
var doc = window.content.document;
var div = doc.getElementsByTagName("div");
for (i=0; i var classe = div[i].getAttribute("class")
if ( classe == "moz-text-html" || classe == "moz-text-plain" ) {
var container = div[i];
break;
}
}
container.innerHTML = "";
container.appendChild(contents);
PrintEnginePrintPreview();
}
catch(e) {};
},

Any help is appreciated!
Thanks!