File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Other JSE/JEE APIs and the fly likes Microsoft.Outlook jacob-1.17-M2-x86.dll Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Bookmark "Microsoft.Outlook jacob-1.17-M2-x86.dll" Watch "Microsoft.Outlook jacob-1.17-M2-x86.dll" New topic

Microsoft.Outlook jacob-1.17-M2-x86.dll

Imre Tokai
Ranch Hand

Joined: Jun 04, 2008
Posts: 130

How to create contact card in Outlook via jacob-1.17-M2-x86.dll
Have been trying combination of below commands, but no success, for now

Any idea?

Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
Libraries such as Jacob really allow you to 'translate' the VBA code used to create macros into Java. So, first take a look here - - and scroll down to the VBA example which looks like this;

Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olContactItem)

This tells you that to crate a new contact, you need an object that refers to the Outlook application and then call the CreateItem() method on this object passing it the correct value to yield a new contact. This value is 2 I think but you can find out by digging around in the Oulook Object Model.

If I have the time, I will try to put together the Jacob code but cannot promise qwhen this will be.
Rob Spoor

Joined: Oct 27, 2005
Posts: 20271

Mark, although the offer is generous, please DontBeACodeMill. If you provide full answers, Imre will not learn a thing.

How To Ask Questions How To Answer Questions
Mark Beardsley
Ranch Hand

Joined: Jun 07, 2013
Posts: 32
OK Rob, I understand. I only meant to infer that I would be testing my hypotheses to ensure it was correct. Not wishing to sound boastful, but it was and the simple example I was going to post was this;

public class OutlookTest {

private ActiveXComponent oleComponent = null;
private Dispatch activeDoc = null;

private final static String APP_ID = "Outlook.Application.12";

public OutlookTest(boolean visibility) {
//this.oleComponent = ActiveXComponent.connectToActiveInstance(OutlookTest.APP_ID);
this.oleComponent = new ActiveXComponent(OutlookTest.APP_ID);
//this.oleComponent.setProperty("Visible", new Variant(visibility));

public void createContact() {
Dispatch disp = null;
Variant var = null;
Object[] args = null;

args = new Object[]{2};
var =, "CreateItem", args);

disp = var.getDispatch();

Dispatch.put(disp, "FullName", "Contact's Full Name");
Dispatch.put(disp, "CompanyName", "Company Name.");
Dispatch.put(disp, "JobTitle", "The Boss");
// Show the contact for de-bugging purposes., "Display");

* Called once processing has completed in order to close down the instance
* of Word.
public void quit() {, "Quit");

The other members, properties, etc of the ContactItem can be read from here -
I agree. Here's the link:
subject: Microsoft.Outlook jacob-1.17-M2-x86.dll
It's not a secret anymore!