Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / December 2004

Tip: Looking for answers? Try searching our database.

Managed Code - Taskpane

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
vb6dev2003 - 01 Dec 2004 19:10 GMT
Hi,

Can you call managed code from the taskpane?  If yes how?

Thanks

vbdev
Matthew Blain \(Serriform\) - 01 Dec 2004 20:11 GMT
The "extension" object lets you do this. However, your solution needs to be
fully trusted.

--Matthew Blain
http://tips.serriform.com/
http://www.developingsolutionswithinfopath.com/

> Hi,
>
[quoted text clipped - 3 lines]
>
> vbdev
gareth@ke.co.za - 02 Dec 2004 12:47 GMT
Yep,

This example (in C#) inserts data from the taskpane (a selected table
row) into the InfoPath document:

1) Create this function in your FormCode.cs file:

public void InsertLoanSchedule(double TotalMonthlyPay,  double
TotalLoanAd)
{
//Add your code here to update xml nodes in xDocument
}

2) In your taskpane htm file add the following function (in the script
tag):

function InsertLoanData(objLoan)
{

window.external.Window.XDocument.Extension.InsertLoanSchedule(objLoan.TotalMonthlyPay,
objLoan.TotalLoanAd);
}

3) Call the function from your html item (eg table row) - a double
click event in this example:

<tr id="item6" TotalLoanAd="3500.00"  TotalMonthlyPay="169.7"
AnnualRate="15" onDblClick="InsertLoanData(this)">
<td unselectable="on" width="109">3500.00</td>
<td unselectable="on" width="412">169.7</td>
</tr>

Voila!!
vbdev - 02 Dec 2004 14:18 GMT
Thanks for the detailed example......

vbdev
G. Tarazi - 02 Dec 2004 20:44 GMT
Another way, if you can't have the form fully trusted, create an event
handler on a node inside InfoPath (managed code), and change the value of
the node from the task pane (the script), that will trigger the managed code
in the event handler.

> Thanks for the detailed example......
>
> vbdev
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.