Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6170753
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:05:41+00:00 2026-05-23T23:05:41+00:00

I am using InfoPath 2007 I have some code written in the form that

  • 0

I am using InfoPath 2007

I have some code written in the form that will put a form into an e-mail. I would like to alter the subject of that e-mail so that I can display a fixed piece of text as well as the results from the data in one of the form fields;

var objEmail;
objEmail = Application.ActiveWindow.MailEnvelope;
objEmail.To = x@y.com;
objEmail.Subject = "extras request";
objEmail.Visible = true;

I want to alter the line

objEmail.Subject = "extras request";

to include display the results from the data in the form field labNO but I am not sure how ?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:05:41+00:00Added an answer on May 23, 2026 at 11:05 pm
    var navigator = MainDataSource.CreateNavigator();
    
    var labNO = navigator.SelectSingleNode(xpath, this.NamespaceManager).Value;
    
    objEmail.Subject = string.Format("extras request {0}", labNO);
    

    The variable ‘xpath’ is a string which points to the labNO field i.e. “/my:myFields/my:labNO”. You can copy it by right-click’ing the field – Copy XPath.

    If the labNO field is within an external DataSource, you’d use this instead:

    var navigator = DataSources["DataSourceName"].CreateNavigator();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I created an InfoPath form that uses VB code to push fields into a
I have an Infopath 2007 form with several views, meant to be used in
Basically I have an InfoPath form which recieves some data from a SharePoint list,
I have been trying to update a text field in a form that will
I have created infopath form library in SharePoint sever2010. I am using Windows server
When using a file attachment control on a InfoPath form as part of a
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
System Specs: Infopath 2007 with c# code-behind Webservices Active Directory I need to get
Scenario I have an InfoPath form. the user fills it in the details, and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.