There is also this blog entry about using task panes with fully trusted managed code forms:
http://www.infopathdev.com/blog/PermaLink.aspx?guid=4cbcbf20-fcb3-4c72-98cc-3365
8df81428

Signature
Greg Collins [InfoPath MVP]
Please visit: http://www.InfoPathDev.com
Hi All,
I have a similar thread started already...(but I wanted to draw attention to
this issue again). When I make a form fully trusted...i receive an error
about lack of permissions. I have an html document as my custom task pane and
I have a function call:
gobjXDocument = window.external.Window.XDocument;
// Set the initial state of the task pane contents.
gobjXDocument.Extension.SetTaskPaneState();
where SetTaskPaneState() is a method in the infopath script. There is more
info in this thread: 'html taskpane permissions with fully trusted forms'.
(forget the deployment problem - not relevant...I also registered the
mshtml.dll but that didnt fix the problem) - thanks for your time all.