Exporting InfoPath fields to a new task in Outlook - InfoPath Dev
in

InfoPath Dev

Exporting InfoPath fields to a new task in Outlook

Last post 04-29-2007 12:04 PM by solvold. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-07-2006 05:39 PM

    • mj02
    • Not Ranked
    • Joined on 06-08-2006
    • Posts 1

    Exporting InfoPath fields to a new task in Outlook

    I haven't been working in InfoPath very long so hopefully you guys can help me.

    I have been working in InfoPath 2003 and am creating a form for my job that has some agenda information. One of the sections deals with tasks and has fields like task description, due date, notes, etc.

    My question is, is there a way (in code or otherwise) to have those task fields be exported to a new task in Outlook (Outlook 2003)?

    I've looked around and haven't found much in the way of help to do this.

    My script file for the template is in Jscript (it has a .js extension). I guess this is another question but how can I use VBscript for the form's script file instead of JScript?


    Thanks,
    Matt
  • 06-09-2006 06:48 AM In reply to

    Re: Exporting InfoPath fields to a new task in Outlook

    Hi

    To export the required fields to Outlook, you will need to create Data connection and write code

    You will first have to add E-mail as a Submitting Data Source.

    1) In Design mode, choose Data Connections from the Tools Menu and then
    click Add.
    2) Select Submit Data, and then click Next.
    3) Select as an e-mail message, and then click Next.
    4) Delete all text in all textboxes on the window (you will be adding all of
    this content back in later using code). Click Next.
    5) On the next window enter a name into the textbox. Remember what you name
    it. Click Finish.

    you can write code as :
    Code in jscript:

    var objEmailAdapter = null;
    objEmailAdapter = XDocument.DataAdapters("<name of the Email dataconnetion>");
    objEmailAdapter.To = "[email protected]";
    objEmailAdapter.Subject = "Status Report";
    objEmailAdapter.Intro = "Name:" + XDocument.DOM.selectSingleNode("/my:myFields/my:Name").text+ "\n" +"Description: " +XDocument.DOM.selectSingleNode("/my:myFields/my:Description").text;
    objEmailAdapter.Submit();


    Code in C#:

    IXMLDOMNode node = thisXDocument.DOM.selectSingleNode("<Xpath of the field1> ");
    string value1 = node.text;

    IXMLDOMNode node = thisXDocument.DOM.selectSingleNode("<Xpath of the field2>");
    string value2 = node.text;

    EmailAdapter oEmail = (EmailAdapter)thisXDocument.DataAdapters["<name of the Email dataconnetion>"];
    oEmail.To = "";
    oEmail.CC = "";
    oEmail.Subject = "";
    oEmail.Intro = value1 + value2;
    oEmail.Submit();
    Madhuri
    http://www.ggktech.com
  • 04-29-2007 12:04 PM In reply to

    Re: Exporting InfoPath fields to a new task in Outlook

    Hey, where can i find the jscript code of the dataconnections?

     I would love to get my hands on that, to filter what datafields i want to put into the body of an email.

Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.