Select fields in Body of Outlook Email (2003) - InfoPath Dev
in

InfoPath Dev

Select fields in Body of Outlook Email (2003)

Last post 12-23-2008 04:17 AM by ZaiZai. 13 replies.
Page 1 of 1 (14 items)
Sort Posts: Previous Next
  • 12-21-2007 07:00 AM

    Select fields in Body of Outlook Email (2003)

    I am using Office 2003 and in an infopath form when they submit the form, i still need the attachment to be sent,

    However, I need a way to pull certain fields from it and put into body of emai, prefer plain text

    For example:

    Name:
    Address:
    Phone:
    Customer #:

    I would like to have the above text bolded - But i am new to jscript and cant figure it out!
    and searched this and usenet with out finding anything that works!

     

    Aprreciate the help[ and time!

     

     

  • 12-21-2007 07:55 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    Welcome to the forum Scott.

    I am pretty sure, that with code, you could customize the Intro of the email to include your fields. mail.Intro but you should be able to search on the site here for posts on email and code.
  • 12-21-2007 08:36 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I appreciate it but seems I can not find anything that has worked so far!

    I am not sure what I am doing wrong..

  • 12-21-2007 08:52 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

  • 12-21-2007 09:27 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    When I use this code I get 0 in the Intro:


    //=======
    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function CTRL136_5::OnClick(eventObj)
    {

    var mail = XDocument.DataAdapters("TEST-NOCC");
    var oOSOA = XDocument.DOM.selectSingleNode("//myFields/secProcessorInfo/fldOSOA");
    var oLocation = XDocument.DOM.selectSingleNode("//myFields/secProcessorInfo/fldLocation");
    mail.Intro = (oOSOA & oLocation);
    mail.Submit();

     

    however if I do

    mail.Intro=("TEST"); i do get test to come up

     

  • 12-21-2007 10:03 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I would insert a line for a MSGBOX(oOSOA) or Alert() etc after each line to verify you are getting the field values and the concatenated value is correct. Can't remember which command does a pop up message in VBS but at least then you can see what is transpiring.  Is & the right choice for concatenation?

  • 12-21-2007 10:45 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    Seems I am still having zero luck.

    using code: 

    //=======
    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function CTRL136_5::OnClick(eventObj)
    {

    var mail = XDocument.DataAdapters("TEST-NOCC");
    var OSOA = XDocument.DOM.selectSingleNode("//myFields/secProcessorInfo/fldOSOA");
    var Location = XDocument.DOM.selectSingleNode("//myFields/secProcessorInfo/fldLocation");
    mail.Intro = "MY TEXT HERE"
    mail.Submit();

    }

     

    I get the "MY TEXT HERE" In the Body of the email

    Now if i try:

    Mail.Intro = OSOA 

     

    I get a type mismatch error on that line

    Of i try:

    mail.Intro = concat(OSOA);

    I get Object expected

     

    What am I doing wrong?

     Eventually I will need Body to have:

     

    Location: LocationA (or what is in the Location text box)
    OSOA: (whatever is in the OSOA text box)

    i will need about a dozen more fields, but if i can get two working, rest should be easy.

     

  • 12-21-2007 10:52 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    OK, paying more attention now.

     Try

    Mail.Into = OSOA.text

    Your assignments are to the fields not the values.

    Also could add .text when you assign the variable so it it a text value.

    Look at some other code example at how to reference field values in code.

  • 12-21-2007 11:05 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I have tried the above OSOA.text and i get "object required"

    But I do apprecaite your help so far.

     

  • 12-21-2007 11:42 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I am still confused on this, from what i have seen every example is:

    Xdocument.DOM.SelectSingleNode("my:myfields/my:comments"))

    I amnot using the my: as it gives me an error it is undefined. but I do not know what to define it as.

    Could that be my issue?

     

    The way my form is set up now is i have a section and the fields inside of this.

     

  • 12-21-2007 01:35 PM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    Adding More in what i have done:

    //=======
    // The following function handler is created by Microsoft Office InfoPath.
    // Do not modify the name of the function, or the name and number of arguments.
    //=======
    function CTRL136_5::OnClick(eventObj)
    {

    var mail = XDocument.DataAdapters("TEST-NOCC");
    var oOSOA = XDocument.DOM.selectSingleNode("/myFields/secProcessorInfo/fldOSOA.text");
    var oLocation = XDocument.DOM.selectSingleNode("/myFields/secProcessorInfo/fldLocation.text");
    var otestme= 31223
    mail.Intro = oLocation
    mail.Submit();

    when i make mail.Intro = otest me it works fine
    using the oLocation or oOSOA 

    I get type mismatch

     I still can not figure out what I have done wrong

     

     

     

     

  • 01-09-2008 11:49 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I am still having issues trying to get this to work:

     

    I still need to submit data into the intro (body of email) in infopath 2003 -

     

    I am using the code.

     

    var mail = XDocument.DataAdapters("Submit");

    var NTID = XDocument.DOM.selectSingleNode("//my:myFields/my:group1/my:txtUserNTID.text"); var CPU = XDocument.DOM.selectSingleNode("//my:myFields/my:group1/my:txtComputerName.text"); mail.Intro = CPU
    Submit();

     

    None of this is working correctly - any comments?

  • 01-09-2008 12:51 PM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    I have solved this issue - Thanks for your support / help

  • 12-23-2008 04:17 AM In reply to

    Re: Select fields in Body of Outlook Email (2003)

    Was wondering how you solved the adding fields values into an InfoPath email data connection that you posted back in January.  You say that you solved it, but no resolution was added. 

    I would like to do something very simililar if possible in InfoPath 2003 and Outlook.

    Thanks.

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