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
210 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
ID: 21841017
Just a guess but try

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

Author Comment

by:Ragnar64
ID: 21841052
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
ID: 21841446
:-)
0

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this step by step procedure, you will come to know the details of creating an Outlook meeting in 2007, 2010, 2013 & 2016.
How to resolve IMCEAEX NDRs in Exchange or Exchange Online related to invalid X500 addresses.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

685 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