Solved

How do I pass values from a web page to a user defined field in an Outlook template?

Posted on 2008-06-22
3
202 Views
Last Modified: 2010-03-30
Dear Experts,

This is a follow-up to question:
http://www.experts-exchange.com/Programming/Languages/Java/Q_23495980.html

I have an Outlook template assigned the value "whatform" in the code below. In addition to setting the To, Subject, and Body, I would like to pass a value from the web page to a user defined field named "pig" in the template.

VB appears to use something like mailItem.UserProperties.pig = "bacon"; but this syntax doesn't work in Java.

Appreciate any help!!

Thanks much,
Ragnar
function OpenOutlookDoc(whatform) 

   { 

      try 

      { 

      outlookApp = new ActiveXObject("Outlook.Application"); 

      nameSpace = outlookApp.getNameSpace("MAPI"); 

      mailFolder = nameSpace.getDefaultFolder(6); 

      mailItem = mailFolder.Items.add(whatform);

      mailItem.To = "Ragnar64@some.net";

      mailItem.Subject = "eMail for you";

      mailItem.Body = "eMail for you.";

 

      mailItem.Display(0)

      } 

      catch(e) 

      { 

      // act on any error that you get 

      } 

   }

Open in new window

0
Comment
Question by:Ragnar64
  • 2
3 Comments
 
LVL 86

Accepted Solution

by:
CEHJ earned 500 total points
Comment Utility
Just a guess but try

mailItem.UserProperties['pig'] = "bacon";
0
 

Author Comment

by:Ragnar64
Comment Utility
Dear CEHJ,

It worked with a slight modification - change [] to () i.e. - mailItem.UserProperties('pig') = "bacon";

Thank you very much - your "guesses" are much better than mine :)

- Ragnar
0
 
LVL 86

Expert Comment

by:CEHJ
Comment Utility
:-)
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Use email signature images to promote corporate certifications and industry awards.
Resolve DNS query failed errors for Exchange
Viewers will learn about arithmetic and Boolean expressions in Java and the logical operators used to create Boolean expressions. We will cover the symbols used for arithmetic expressions and define each logical operator and how to use them in Boole…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now